Boost C++ Libraries: Ticket #282: boost::optional<enum> fails with /CLR https://svn.boost.org/trac10/ticket/282 <pre class="wiki">----- #include &lt;boost\optional.hpp&gt; #using &lt;mscorlib.dll&gt; #include &lt;tchar.h&gt; using namespace System; enum Numbers { Zero, One, Two, Three }; // This is the entry point for this application int _tmain(void) { boost::optional&lt;Numbers&gt; num; return 0; } ----- optional.hpp(347): error C2300: 'System::Enum' : class does not have a destructor called '~T' I'm using boost 1.31.0; this fails in both VC7.0 and VC7.1. Removing "#using &lt;mscorlib.dll&gt;" and "using namespace System;" gets rid of the compiler error, but then you can't use things like System::String* Thanks, Dan sourceforge.net@jdanielsmith.org </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/282 Trac 1.4.3 Marshall Clow Wed, 22 Aug 2007 21:41:22 GMT status, component, description changed; severity set https://svn.boost.org/trac10/ticket/282#comment:1 https://svn.boost.org/trac10/ticket/282#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">new</span> </li> <li><strong>component</strong> <span class="trac-field-old">None</span> → <span class="trac-field-new">optional</span> </li> <li><strong>description</strong> modified (<a href="/trac10/ticket/282?action=diff&amp;version=1">diff</a>) </li> <li><strong>severity</strong> → <span class="trac-field-new">Problem</span> </li> </ul> Ticket anonymous Tue, 06 Nov 2007 22:29:53 GMT <link>https://svn.boost.org/trac10/ticket/282#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/282#comment:2</guid> <description> <p> Unfortunately this is due to a framework bug: System::Enum does not have a destructor (is an enum) but doesn't support a pseudo-destructor call either (see 12.4.15) which is neccesary to allow the code to compile without complaining about the lack of a destructor. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Fernando Cacciola</dc:creator> <pubDate>Tue, 06 Nov 2007 22:31:11 GMT</pubDate> <title>status, resolution changed https://svn.boost.org/trac10/ticket/282#comment:3 https://svn.boost.org/trac10/ticket/282#comment:3 <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-old">None</span> → <span class="trac-field-new">wontfix</span> </li> </ul> <p> (I wrote the response about but without logging in, accidentally) </p> Ticket