[Boost-bugs] [Boost C++ Libraries] #11071: boost serialize compile errors on simple implementation

Subject: [Boost-bugs] [Boost C++ Libraries] #11071: boost serialize compile errors on simple implementation
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2015-03-04 20:59:41


#11071: boost serialize compile errors on simple implementation
------------------------------+---------------------------
 Reporter: tony@… | Owner: ramey
     Type: Support Requests | Status: new
Milestone: To Be Determined | Component: serialization
  Version: Boost 1.57.0 | Severity: Problem
 Keywords: |
------------------------------+---------------------------
 Platform specifics: Fedora 21 g++ 4.9.2-6

 Here's the error ....

 {{{
 $ g++ -c kabi-serial.cpp -lboost_serialization
 kabi-serial.cpp: In function ‘void boost::serialization::kb_write_list()’:
 kabi-serial.cpp:41:13: error: expected ‘;’ before ‘oa’
    serialize oa(ofs);

 kabi-serial.cpp:41:20: error: statement cannot resolve address of
 overloaded function
    serialize oa(ofs);
                 ^
 kabi-serial.cpp:42:3: error: ‘oa’ was not declared in this scope
    oa << ql;
 }}}

 And here's the kabi-serial.cpp source ...

 {{{
 #include <boost/serialization/vector.hpp>
 #include <vector>

 namespace boost {
 namespace serialization {

 class Cqnodelist
 {
 public:
      friend class boost::serialization::access;
      Cqnodelist(){}
      std::vector<int>qnodelist;

      template<class Archive>
      void serialize(Archive & ar, const unsigned int version)
      {
          ar & qnodelist;
      }
  };

  void kb_write_list ()
  {
      Cqnodelist ql;

      ofstream ofs("kabi-list.dat");
      {
          serialize oa(ofs);
          oa << ql;
      }
  }
  }
  }
 }}}

 I based the source code on the simplest of the serialization examples,
 except using the serialization of the stl vector object.

 I'm sure it's simple, but what am I missing?

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11071>
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:50:18 UTC