Steven C. said:
class
I believe vector<bool> is a special case for this.
__________________________________________
Really that would be great.
Not 'would', but 'is'
=========================================================
ISO/IEC 14882:1998(E)
23.2.5 Class vector<bool>
1 To optimize space allocation, a specialization of vector for
bool elements is provided:
namespace std {
template <class Allocator> class vector<bool, Allocator> {
public:
// types:
typedef bool const_reference;
typedef (implementation defined) iterator; // See 23.1
typedef (implementation defined) const_iterator; // See 23.1
typedef (implementation defined) size_type; // See 23.1
typedef (implementation defined) difference_type;// See 23.1
typedef bool value_type;
typedef Allocator allocator_type;
typedef (implementation defined) pointer;
typedef (implementation defined) const_pointer
typedef std::reverse_iterator<iterator> reverse_iterator;
typedef std::reverse_iterator<const_iterator>
const_reverse_iterator;
// bit reference:
class reference {
friend class vector;
reference();
public:
~reference();
operator bool() const;
reference& operator=(const bool x);
reference& operator=(const reference& x);
void flip(); // flips the bit
};
[member function descriptions omitted for brevity -- MKW]
2 reference is a class that simulates the behavior of references
of a single bit in vector<bool>.
=========================================================
HTH,
-Mike