Topic: serializing vector<bool>


Author: Sean Rohead <SEAN@erudite.com>
Date: 1997/05/07
Raw View
Is there a standard way of gaining access to the underlying bits of a vector<bool>?  I would like to serialize the information to a file and am trying to avoid a) serializing it as formatted text, which completely negates any space savings associated with a packed vector, and b) creating my own buffers, reading the data from the vector and setting the corresponding buffer bit one bit at a time.  The whole point of vector<bool> is that it's implemented as a packed bitfield, but if you can't serialize it in
a standard and efficient way, it's usefulness is somewhat limited.
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu
]