Re: [Boost-bugs] [Boost C++ Libraries] #10488: Compilation of serializing shared_ptr<const Object> fails

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #10488: Compilation of serializing shared_ptr<const Object> fails
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-10-29 10:10:38


#10488: Compilation of serializing shared_ptr<const Object> fails
-------------------------+-------------------------------------------------
  Reporter: | Owner: ramey
  visa.jokelainen@… | Status: closed
      Type: Bugs | Component: serialization
 Milestone: To Be | Severity: Regression
  Determined | Keywords: shared_ptr serialization const
   Version: Boost | compilation
  1.56.0 |
Resolution: duplicate |
-------------------------+-------------------------------------------------

Comment (by reder <rouge.richard@…>):

 This is a regression. Not being able to serialize a shared_ptr<const
 Object> is indeed very painful. Ticket 3123 shows it is not absurd:
 imagine I have a


 {{{ typedef map<string,shared<book>> library; }}}


 Since I do not want people to write on the books, I'd prefer a


 {{{typedef map<string,shared<const book>> library;}}}


 and be able to write/load the contents of my library.

 Anyhow, it seems to be just a matter of changing line 59 of
 serialization/shared_ptr_helper.cpp from


 {{{
   SPT<void> // address shared ptr to single instance
 }}}


 to


 {{{
   SPT<const void> // address shared ptr to single instance
 }}}


 to regain previous behaviour (if one can check extensively).

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/10488#comment:4>
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:17 UTC