BOOST_CLASS_EXPORT conflicts with xml_iarchive.hpp
Hello All,
Could someone please help me to understand why code below fails to
compile with STATIC_ASSERTION_FAILURE in basic_xml_iarchive.hpp
// If your program fails to compile here, its most likely due
to
// not specifying an nvp wrapper around the variable to
// be serialized.
BOOST_STATIC_ASSERT(0 == sizeof(T));
Code does compile if BOOST_CLASS_EXPORT line is commeted out.
#include
On Tuesday, April 24, 2007 at 16:07:03 (-0700) Oleg V. Zhylin writes:
... // If your program fails to compile here, its most likely due to // not specifying an nvp wrapper around the variable to // be serialized.
I believe you need the BOOST_SERIALIZATION_NVP wrapper, here:
ar & i;
around i, thus: ar & BOOST_SERIALIZATION_NVP(i); Bill
Thanks for noticing this, Bill. Thus the problem in my main project
is that NVP wrapper is missing somewhere. Too bad this can only be
tracked down manually...
--- Bill Lear
On Tuesday, April 24, 2007 at 16:07:03 (-0700) Oleg V. Zhylin writes:
... // If your program fails to compile here, its most likely due to // not specifying an nvp wrapper around the variable to // be serialized.
I believe you need the BOOST_SERIALIZATION_NVP wrapper, here:
ar & i;
around i, thus:
ar & BOOST_SERIALIZATION_NVP(i);
Bill _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
WBR Oleg V. Zhylin ovz@yahoo.com __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Oleg V. Zhylin wrote: Hmmm - whenever this happens to me I just display a back trace of the stack. The most recent serialialization is the one missing the NVP. takes about two seconds. Robert Ramey
Thanks for noticing this, Bill. Thus the problem in my main project is that NVP wrapper is missing somewhere. Too bad this can only be tracked down manually...
--- Bill Lear
wrote: On Tuesday, April 24, 2007 at 16:07:03 (-0700) Oleg V. Zhylin writes:
... // If your program fails to compile here, its most likely due to // not specifying an nvp wrapper around the variable to // be serialized.
I believe you need the BOOST_SERIALIZATION_NVP wrapper, here:
ar & i;
around i, thus:
ar & BOOST_SERIALIZATION_NVP(i);
Bill _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
WBR Oleg V. Zhylin ovz@yahoo.com
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
How would one display back trace of the stack if I get _compiler_
error?
To track this issue down I've done the following:
1) Commented out all actual serialization code, thus serialization
templates were only triggered by BOOST_CLASS_EXPORT.
2) Commented out all BOOST_CLASS_EXPORTs one by one until I've pinned
the class where problem is.
3) Commenting out pieces of serialization code in just one class is
effective enough to find the problematic piece.
I wonder if we can associate some kind of static assertion with
BOOST_CLASS_EXPORT for situations like this one...
--- Robert Ramey
Oleg V. Zhylin wrote:
Hmmm - whenever this happens to me I just display a back trace of the stack. The most recent serialialization is the one missing the NVP. takes about two seconds.
Robert Ramey
Thanks for noticing this, Bill. Thus the problem in my main project is that NVP wrapper is missing somewhere. Too bad this can only be tracked down manually...
--- Bill Lear
wrote: On Tuesday, April 24, 2007 at 16:07:03 (-0700) Oleg V. Zhylin writes:
... // If your program fails to compile here, its most likely due to // not specifying an nvp wrapper around the variable to // be serialized.
I believe you need the BOOST_SERIALIZATION_NVP wrapper, here:
ar & i;
around i, thus:
ar & BOOST_SERIALIZATION_NVP(i);
Bill _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
WBR Oleg V. Zhylin ovz@yahoo.com
__________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
WBR Oleg V. Zhylin ovz@yahoo.com __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
Oleg V. Zhylin wrote:
How would one display back trace of the stack if I get _compiler_ error?
LOL - my VC compiler give a back trace when ever I get a compiler error. Sometimes it's veeeeerrrrrryyyy long. I thought I remembered gcc doing this as well. But maybe I'm mis-remembering. Robert Ramey
participants (3)
-
Bill Lear
-
Oleg V. Zhylin
-
Robert Ramey