[serialization] serializing std::bitset

I need to serialize a std::bitset. I found an implementation by Brian Ravnsgaard Riis from 2006 in the vault that doesn't work with xml archives out of the box since it fails to use nvp wrappers internally. Should I just add the nvp wrappers or is there anything more current for serializing std::bitsets?

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Kenny Riddile wrote:
I need to serialize a std::bitset. I found an implementation by Brian Ravnsgaard Riis from 2006 in the vault that doesn't work with xml archives out of the box since it fails to use nvp wrappers internally. Should I just add the nvp wrappers or is there anything more current for serializing std::bitsets?
I doubt it. There wasn't over-much enthusiasm on the list back then IIRC. I've moved away from bitset myself in the case where I needed it back then, but the implementation you found should still work. As for the NVP wrappers.. Well, I was pretty new to Boost.Serialization at the time, and hadn't gotten around to needing XML archives yet. You can just add the NVP wrappers then it should work. /Brian -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFJ1jhuk1tAOprY6QERAkVXAJ0S9i9NtWTYVpvPh+kSZFafSy1lmQCfT9q8 rFRYkd5Ejbu+pTMwFWqjmzk= =gVkj -----END PGP SIGNATURE-----

Brian Ravnsgaard Riis wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Kenny Riddile wrote:
I need to serialize a std::bitset. I found an implementation by Brian Ravnsgaard Riis from 2006 in the vault that doesn't work with xml archives out of the box since it fails to use nvp wrappers internally. Should I just add the nvp wrappers or is there anything more current for serializing std::bitsets?
I doubt it. There wasn't over-much enthusiasm on the list back then IIRC. I've moved away from bitset myself in the case where I needed it back then, but the implementation you found should still work.
As for the NVP wrappers.. Well, I was pretty new to Boost.Serialization at the time, and hadn't gotten around to needing XML archives yet. You can just add the NVP wrappers then it should work.
/Brian -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFJ1jhuk1tAOprY6QERAkVXAJ0S9i9NtWTYVpvPh+kSZFafSy1lmQCfT9q8 rFRYkd5Ejbu+pTMwFWqjmzk= =gVkj -----END PGP SIGNATURE----- _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Thanks...I went ahead and added the NVP wrappers and it works. Still, I would like to see std::bitset support actually added to the library. I was a bit surprised when I didn't find it, especially after reading this line in the library documentation: "The serialization library contains code for serialization of all STL classes."

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Kenny Riddile wrote:
Thanks...I went ahead and added the NVP wrappers and it works. Still, I would like to see std::bitset support actually added to the library. I was a bit surprised when I didn't find it, especially after reading this line in the library documentation:
Same here. That was why I started that thread back then. However...
"The serialization library contains code for serialization of all STL classes."
...by most people's definition, I don't think std::bitset is actually part of the STL. The standard C++ library, yes indeed, but not the STL. So that line doesn't actually promise it will be there. Not that this is a good reason for it not to be there, of course. Seeing, though, as you and I are the only two persons in three years to actually request it, maybe std::bitset is simply not that much used... /Brian -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFJ1mlBk1tAOprY6QERAohpAKCXoc2ibLOs8xYHLLfCGEexv9VNvwCfbNGp qzVwrFBuc/Uq9/DtNSv4VRE= =vVEt -----END PGP SIGNATURE-----

If someone want's to make test for this similar to the tests in the serialization library we can consider adding it in. Prepare a TRAC item. Robert Ramey Brian Ravnsgaard Riis wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Kenny Riddile wrote:
Thanks...I went ahead and added the NVP wrappers and it works. Still, I would like to see std::bitset support actually added to the library. I was a bit surprised when I didn't find it, especially after reading this line in the library documentation:
Same here. That was why I started that thread back then. However...
"The serialization library contains code for serialization of all STL classes."
...by most people's definition, I don't think std::bitset is actually part of the STL. The standard C++ library, yes indeed, but not the STL. So that line doesn't actually promise it will be there.
Not that this is a good reason for it not to be there, of course. Seeing, though, as you and I are the only two persons in three years to actually request it, maybe std::bitset is simply not that much used...
/Brian
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFJ1mlBk1tAOprY6QERAohpAKCXoc2ibLOs8xYHLLfCGEexv9VNvwCfbNGp qzVwrFBuc/Uq9/DtNSv4VRE= =vVEt -----END PGP SIGNATURE----- _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

I have created ticket #2912: https://svn.boost.org/trac/boost/ticket/2912 and attached the implementation I'm currently using along with a unit test. -Kenny Riddile Robert Ramey wrote:
If someone want's to make test for this similar to the tests in the serialization library we can consider adding it in. Prepare a TRAC item.
Robert Ramey
Brian Ravnsgaard Riis wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Kenny Riddile wrote:
Thanks...I went ahead and added the NVP wrappers and it works. Still, I would like to see std::bitset support actually added to the library. I was a bit surprised when I didn't find it, especially after reading this line in the library documentation: Same here. That was why I started that thread back then. However...
"The serialization library contains code for serialization of all STL classes." ...by most people's definition, I don't think std::bitset is actually part of the STL. The standard C++ library, yes indeed, but not the STL. So that line doesn't actually promise it will be there.
Not that this is a good reason for it not to be there, of course. Seeing, though, as you and I are the only two persons in three years to actually request it, maybe std::bitset is simply not that much used...
/Brian
-----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.7 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFJ1mlBk1tAOprY6QERAohpAKCXoc2ibLOs8xYHLLfCGEexv9VNvwCfbNGp qzVwrFBuc/Uq9/DtNSv4VRE= =vVEt -----END PGP SIGNATURE----- _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (3)
-
Brian Ravnsgaard Riis
-
Kenny Riddile
-
Robert Ramey