Boost logo

Boost :

From: Jeremy Siek (jsiek_at_[hidden])
Date: 2002-07-29 10:29:16


On Sat, 27 Jul 2002, David Abrahams wrote:

dave> There's no description of the reference type, other than a mention
dave> that it exists. So, for example, I can't tell whether the following
dave> code will work:
dave>
dave> dynamic_bitset<> s(5);
dave> s[1] = s[2] = s[3] = 1;
dave>
dave> or
dave>
dave> s[1] |= s[2];
dave>
dave> We need a full description of all the operations on reference.

There is a description. Here's what the docs say:

Member Typesdefs

dynamic_bitset::reference

A proxy class that acts as a reference to a single bit. It contains an
assignment operator, a conversion to bool, an operator~, and a member
function flip. It exists only as a helper class for dynamic_bitset's
operator[]. That is, it supports the expressions x = b[i], b[i] = x, b[i]
= b[j], x = ~b[i], and b[i].flip(). (Where b is a dynamic_bitset and x is
a bool.)

-Jeremy

----------------------------------------------------------------------
 Jeremy Siek http://php.indiana.edu/~jsiek/
 Ph.D. Student, Indiana Univ. B'ton email: jsiek_at_[hidden]
 C++ Booster (http://www.boost.org) office phone: (812) 855-3608
----------------------------------------------------------------------


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk