Boost C++ Libraries: Ticket #806: serialization of classes with overloaded operator & fails https://svn.boost.org/trac10/ticket/806 <pre class="wiki">the serialization of the following class fails to compile at line 363 in detail/iserializer.hpp, struct load_standard, method invoke, line void * x = &amp; const_cast&lt;typex &amp;&gt;(t); class wrapped_value { public: const int* operator &amp; () { // returns the address of the wrapped integer, which may noy be the same as the address of the instance return &amp;a; } template &lt;typename Archive&gt; void serialize(Archive&amp; ar, const unsigned version) { ar &amp; a; } private: int a; }; due to the overloaded '&amp;' operator getting the address of the instance fails. a proposed patch is void * x = boost::addressof( const_cast&lt;typex &amp;&gt;(t) ); which seems to compile and work correctly cheers </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/806 Trac 1.4.3 Robert Ramey Wed, 17 Jan 2007 19:15:28 GMT status changed https://svn.boost.org/trac10/ticket/806#comment:1 https://svn.boost.org/trac10/ticket/806#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> </ul> <pre class="wiki">Logged In: YES user_id=396141 Originator: NO see section of "rationale" in the docs which address "const" </pre> Ticket