Converting an integer to a STL bitset

I am looking for a STL function that converts an integer to a STL bitset.
Please suggest.
How about the constructor
bitset ( unsigned long val )
?

You would have to fiddle with signs and two complement and such things yourself...
Good idea. Thank you.

ps: I plan to buy a STL book. Could you suggest?
Generic Programming and the STL: Using and Extending the C++ Standard Template Library by Matthew H. Austern is a great book on the STL and it's easy to follow.
Topic archived. No new replies allowed.