[Boost-bugs] [Boost C++ Libraries] #2760: A problem with serialization libraries when compilin on vc9 with /Za

Subject: [Boost-bugs] [Boost C++ Libraries] #2760: A problem with serialization libraries when compilin on vc9 with /Za
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2009-02-14 16:18:49


#2760: A problem with serialization libraries when compilin on vc9 with /Za
---------------------------------------------------+------------------------
 Reporter: Greg Ravikovich <grisharav_at_[hidden]> | Owner: ramey
     Type: Bugs | Status: new
Milestone: Boost 1.39.0 | Component: serialization
  Version: Boost 1.38.0 | Severity: Problem
 Keywords: |
---------------------------------------------------+------------------------
 I have a compilation problem when serializing to a text_oarchive.
 The problem doesn't happen when serializing to a binary_oarchive. here's a
 sample code:

 #include <boost/test/unit_test.hpp>

 #include <boost/serialization/serialization.hpp>
 #include <boost/archive/text_oarchive.hpp>
 #include <boost/archive/binary_oarchive.hpp>
 #include <boost/serialization/tracking.hpp>


 struct SerializableStruct
 {
    int m_data;
 };

 namespace boost
 {
    namespace serialization
    {
       template<class Archive>
       void serialize(Archive & ar, SerializableStruct & s, unsigned int )
       {
          ar & s.m_data;
       }
    }
 }

 BOOST_CLASS_TRACKING(SerializableStruct,boost::serialization::track_never);


 BOOST_AUTO_TEST_SUITE(TestGeneralSerialize)


 BOOST_AUTO_TEST_CASE(TestTextArchive)
 {
    boost::archive::text_oarchive out(std::cout);
    SerializableStruct s;
    s.m_data = 10;
    out << s;
 }

 BOOST_AUTO_TEST_CASE(TestBinaryArchive)
 {
    std::stringstream str;
    boost::archive::binary_oarchive out(str);
    SerializableStruct s;
    s.m_data = 10;
    out << s;
 }

 BOOST_AUTO_TEST_SUITE_END();


 The code compiles fine under boost 1.35, or when using /Za (Enable
 language extensions), but fails in boost\archive\detail\oserializer.hpp
 line 538, BOOST_STATIC_WARNING (...)
 This code should require no language extension during compilation.

 Greg

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/2760>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:59 UTC