Re: [Boost-bugs] [Boost C++ Libraries] #3977: Compile error on make_nvp with reference data member

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #3977: Compile error on make_nvp with reference data member
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-03-08 13:31:12


#3977: Compile error on make_nvp with reference data member
----------------------------------+-----------------------------------------
  Reporter: kondo@… | Owner: ramey
      Type: Patches | Status: closed
 Milestone: Boost 1.43.0 | Component: serialization
   Version: Boost 1.42.0 | Severity: Problem
Resolution: wontfix | Keywords:
----------------------------------+-----------------------------------------

Comment(by kondo@…):

 Now, I have understood your policy.
 Serializing the reference data member is asymmetric. And we should write
 such code.
 But my patch helps hide the such code.

 Now, I think to prepare below cast in my code.

 {{{
 #!cpp
 template <typename T>
 T* const& reference_serialize_cast(T* const& t)
 {
     return t;
 }
 }}}

 {{{
 #!cpp
     ar << boost::serialization::make_nvp("ref_",
 reference_serialize_cast(&p->ref_));
 }}}

 By the way,
>The reason that we trap a attempt to serialize a non-const is described
>in the rationale section of the documentation

 means
 http://www.boost.org/doc/libs/1_42_0/libs/serialization/doc/rationale.html
 ?

 or you mean
 http://www.boost.org/doc/libs/1_42_0/libs/serialization/doc/serialization.html#references
 ?

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/3977#comment:6>
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:02 UTC