Boost Serialization/Archive for boost::variant using Microosft Visual C++ 2005 compiler

Hi folks, I have a problem using boost::binary_oarchive with MSVS C++ 2005 compiler. I'm using boost 1.33.1. Consider a small example below: #include <boost/archive/binary_oarchive.hpp> #include <boost/serialization/variant.hpp> #include <sstream> void main() { boost::variant<int> v; std::stringstream output; boost::archive::binary_oarchive oa(output); oa << v; } The last line results in the following compiler error: Error 1 error C2027: use of undefined type 'boost::STATIC_ASSERTION_FAILURE<x>' c:\mydata\myprojects\ny2325 \svn\api\shared\include\boost\archive\detail\oserializer.hpp 567 Serializing primitive types like 'int' has no problems. Any help is greatly appreciated. Thanks, Eugene Prystupa

Hello Eugene, ----- Mensaje original ----- De: Eugene Prystupa <prystupa@sqlapi.com> Fecha: Jueves, Noviembre 9, 2006 6:59 pm Asunto: [boost] Boost Serialization/Archive for boost::variant using Microosft Visual C++ 2005 compiler Para: boost@lists.boost.org
Hi folks,
I have a problem using boost::binary_oarchive with MSVS C++ 2005 compiler. I'm > using boost 1.33.1. Consider a small example below:
[STATIC_ASSERTION_FAILURE whn trying to save a non-const object]
Serializing primitive types like 'int' has no problems. Any help is greatly appreciated.
See http://boost.org/libs/serialization/doc/rationale.html#trap for an explanation of the problem. HTH, Joaquín M López Muñoz Telefónica, Investigación y Desarrollo

"JOAQUIN LOPEZ MU?Z" wrote:
See
http://boost.org/libs/serialization/doc/rationale.html#trap
for an explanation of the problem. HTH,
I just read the section for curiosity and noticed a few typos. Under the trap disabled example #6 there is: "Each loaded shared_ptr<construct_from> is going to have its own distince raw pointer." and "It would well be that the problem is not even discovered until after the archives are loaded." which should be: "Each loaded shared_ptr<construct_from> is going to have its own distinct raw pointer." and "It could well be that the problem is not even discovered until after the archives are loaded." Under the trap enabled example #3 under the second bullet's #2 there is: "OK, I'll at the following to my construct_from.hpp to solve the problem." which should be: "OK, I'll add the following to my construct_from.hpp to solve the problem." Thanks, Michael Marcin

Thanks for spotting this - fixed in 1.35 Robert Ramey Michael Marcin wrote:
"JOAQUIN LOPEZ MU?Z" wrote:
See
http://boost.org/libs/serialization/doc/rationale.html#trap
for an explanation of the problem. HTH,
I just read the section for curiosity and noticed a few typos.
Under the trap disabled example #6 there is: "Each loaded shared_ptr<construct_from> is going to have its own distince raw pointer." and "It would well be that the problem is not even discovered until after the archives are loaded." which should be: "Each loaded shared_ptr<construct_from> is going to have its own distinct raw pointer." and "It could well be that the problem is not even discovered until after the archives are loaded."
Under the trap enabled example #3 under the second bullet's #2 there is: "OK, I'll at the following to my construct_from.hpp to solve the problem." which should be: "OK, I'll add the following to my construct_from.hpp to solve the problem."
Thanks,
Michael Marcin
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Thanks, Joaquín. This solved my problem. ""JOAQUIN LOPEZ MU?Z"" <joaquin@tid.es> wrote in message news:f8fdfcf14e67.4e67f8fdfcf1@tid.es... Hello Eugene, ----- Mensaje original ----- De: Eugene Prystupa <prystupa@sqlapi.com> Fecha: Jueves, Noviembre 9, 2006 6:59 pm Asunto: [boost] Boost Serialization/Archive for boost::variant using Microosft Visual C++ 2005 compiler Para: boost@lists.boost.org
Hi folks,
I have a problem using boost::binary_oarchive with MSVS C++ 2005 compiler. I'm > using boost 1.33.1. Consider a small example below:
[STATIC_ASSERTION_FAILURE whn trying to save a non-const object]
Serializing primitive types like 'int' has no problems. Any help is greatly appreciated.
See http://boost.org/libs/serialization/doc/rationale.html#trap for an explanation of the problem. HTH, Joaquín M López Muñoz Telefónica, Investigación y Desarrollo _______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (4)
-
"JOAQUIN LOPEZ MU?Z"
-
Eugene Prystupa
-
Michael Marcin
-
Robert Ramey