Boost C++ Libraries: Ticket #2755: compile error in boost_intrusive 1.38.0: a set of classes with protected destructor https://svn.boost.org/trac10/ticket/2755 <p> the following short code generates a compiler error: </p> <p> #include &lt;stdio.h&gt; </p> <p> #include &lt;boost/intrusive/set.hpp&gt; #include &lt;boost/noncopyable.hpp&gt; </p> <p> using namespace boost::intrusive; </p> <p> struct node_t : </p> <blockquote> <p> set_base_hook&lt;optimize_size&lt;true&gt; &gt; </p> </blockquote> <p> { </p> <blockquote> <p> bool operator &lt; (const node_t&amp; right) const; </p> </blockquote> <p> protected: </p> <blockquote> <p> ~node_t(); </p> </blockquote> <p> }; </p> <p> int main(int argc, char* argv[]) { </p> <blockquote> <p> set&lt;node_t&gt; nodes; nodes.insert(* new node_t); return 0; </p> </blockquote> <p> } </p> <p> <em> end of code </em></p> <p> reason of compiler error: </p> <p> in /boost/intrusive/detail/mpl.hpp, line 69: </p> <p> static const bool value = sizeof(dispatch(trigger())) == sizeof(true_t); </p> <p> trigger() function (line 67) returns an instance, thus forcing a compiler to look for destructor. it the sample above the destructor is protected, so it can't be accessed. </p> <p> suggested solution: in /boost/intrusive/detail/mpl.hpp, line 67: static const T&amp; trigger(); </p> <p> boost 1.37.0 had no such problem </p> <p> best regards, vlad fmot.fics@… </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/2755 Trac 1.4.3 Ion Gaztañaga Tue, 17 Feb 2009 17:03:34 GMT <link>https://svn.boost.org/trac10/ticket/2755#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/2755#comment:1</guid> <description> <p> Fixed in SVN, revision 51290. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ion Gaztañaga</dc:creator> <pubDate>Tue, 17 Feb 2009 17:07:23 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/2755#comment:2 https://svn.boost.org/trac10/ticket/2755#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> Ticket