Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2002-07-29 10:52:52

From: "Jeremy Siek" <jsiek_at_[hidden]>

> 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.

I never saw the following.

> 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.)

Is that a complete description?

I can't know whether s[1] = s[2] = s[3] is legal without knowing the type
and precise semantics of (s[2] = s[3]).

There's also no description of the semantics of any of these operations,
though I can probably intuit them. Seems a little informal to me.


           David Abrahams * Boost Consulting
dave_at_[hidden] *

Boost list run by bdawes at, gregod at, cpdaniel at, john at