Boost logo

Boost Users :

From: Dave Steffen (dgsteffen_at_[hidden])
Date: 2005-12-15 10:50:31


Daniel Krügler writes:
> Dave Steffen wrote:
> > Folks,
> >
> > I used dynamic_bitset for the first time last night - nifty! I am
> > curious, though, about how to construct a bitset of all 1's. Right
> > now I'm doing this:
> >
> > dynamic_bitset foo(n);
> > foo.set();
> >
> > Is there a more efficient way to generate a bitset will all bits set?
> >
> > Thanks very much!
>
> boost::dynamic_bitset strongly matches the interface of
> std::bitset, this is probably the reason for the non-existence of a
> constructor allowing to set an initial value for each element.

 Never having used std::bitset, I sort of assumed that such a
 constructor would exist. :-) I like your proposal for an additional
 ctor for both sorts of bitset.

------------------------------------------------------------------------
Dave Steffen, Ph.D. "We warn the reader in advance that the proof
Software Engineer IV presented here depends on a clever but highly
Numerica Corporation unmotivated trick."
ph (970) 419-8343 x27
fax (970) 223-6797 -- Howard Anton, "Elementary Linear Algebra"
dgsteffen_at_[hidden]
______________________
Numerica Disclaimer:
This message and any attachments are intended only for the individual
or entity to which the message is addressed. It is proprietary and
may contain privileged information. If you are neither the intended
recipient nor the agent responsible for delivering the message to the
intended recipient, you are hereby notified that any review,
retransmission, dissemination, or taking of any action in reliance
upon, the information in this communication is strictly prohibited,
and may be unlawful. If you feel you have received this communication
in error, please notify us immediately by returning this Email to the
sender and deleting it from your computer.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net