Boost C++ Libraries: Ticket #2326: Library does not directly support serializing data of type "foo**" https://svn.boost.org/trac10/ticket/2326 <p> The following example fails to compile, trying to find a .serialize() member function in an int*. Clearly the user can program around this, but serializing pointers-to-pointers seems a natural capability that should be in the library. </p> <p> #include &lt;fstream&gt; </p> <p> #include "boost/archive/text_oarchive.hpp" </p> <p> class foo { </p> <blockquote> <p> friend class boost::serialization::access; </p> </blockquote> <blockquote> <p> template&lt;class archive&gt; </p> </blockquote> <blockquote> <p> void serialize(archive&amp; ar, const unsigned int version) { </p> </blockquote> <blockquote> <blockquote> <p> ar &amp; BOOST_SERIALIZATION_NVP(buff); </p> </blockquote> </blockquote> <blockquote> <blockquote> <p> ar &amp; BOOST_SERIALIZATION_NVP(ptr); </p> </blockquote> </blockquote> <blockquote> <blockquote> <p> } </p> </blockquote> </blockquote> <p> public: </p> <blockquote> <p> foo() : ptr(&amp;buff<a class="changeset" href="https://svn.boost.org/trac10/changeset/3" title="Tweak disclaimer text">[3]</a>) {} </p> </blockquote> <blockquote> <p> int* buff<a class="changeset" href="https://svn.boost.org/trac10/changeset/10" title="*** empty log message *** ">[10]</a>; </p> </blockquote> <blockquote> <p> int<strong> ptr; </strong></p> </blockquote> <blockquote> <p> }; </p> </blockquote> <p> int main() { </p> <blockquote> <p> foo f; </p> </blockquote> <blockquote> <p> std::ofstream serial("serial"); </p> </blockquote> <blockquote> <p> boost::archive::text_oarchive oa(serial); </p> </blockquote> <blockquote> <p> oa &lt;&lt; BOOST_SERIALIZATION_NVP(f); </p> </blockquote> <blockquote> <p> return 0; </p> </blockquote> <blockquote> <p> } </p> </blockquote> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2326 Trac 1.4.3 Robert Ramey Thu, 18 Sep 2008 15:44:22 GMT status changed https://svn.boost.org/trac10/ticket/2326#comment:1 https://svn.boost.org/trac10/ticket/2326#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> </ul> Ticket