Boost C++ Libraries: Ticket #136: operator does not work under 3.2 https://svn.boost.org/trac10/ticket/136 <pre class="wiki">g++ -I.. -I../base -g -O2 -ftemplate-depth-32 -c Var.cc -o Var.o /usr/include/boost/cast.hpp: In function `Target boost::numeric_cast(Source) [with Target = int, Source = poe::OpCode]': Var.cc:452: instantiated from here /usr/include/boost/cast.hpp:344: creating array with size zero (`false') Var.cc:519:26: warning: pasting "operator" and "+" does not give a valid preprocessing token Var.cc:519:26: warning: pasting "&amp;" and "add" does not give a valid preprocessing token ... (many more lines of warnings with different operators) Same class compiles fine under gcc-2.95 Part of Var's header: class Var : boost::totally_ordered&lt;Var&gt;, // &gt;, &gt;=, &lt;=, etc. boost::incrementable&lt;Var&gt;, // ++(Var) boost::totally_ordered&lt;Var, int&gt;, // order vs various types boost::totally_ordered&lt;Var, double&gt;, boost::totally_ordered&lt;Var, OpCode&gt;, boost::totally_ordered&lt;Var, char&gt;, boost::totally_ordered&lt;Var, bool&gt;, boost::integer_arithmetic&lt;Var&gt;, // + - / * % boost::bitwise&lt;Var&gt;, // &amp; | ^ boost::shiftable&lt;Var&gt; // &lt;&lt; &gt;&gt; { </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/136 Trac 1.4.3 opiate Tue, 21 Jan 2003 05:37:06 GMT <link>https://svn.boost.org/trac10/ticket/136#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/136#comment:1</guid> <description> <pre class="wiki">Logged In: YES user_id=15747 Looks like I misfiled this -- it looks like a boost/cast problem . Sorry. </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>david_abrahams</dc:creator> <pubDate>Wed, 28 May 2003 10:26:53 GMT</pubDate> <title>status changed https://svn.boost.org/trac10/ticket/136#comment:2 https://svn.boost.org/trac10/ticket/136#comment:2 <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=52572 If you look at boost/cast.hpp, line 344, you'll see that the error you're seeing is a static assertion: it means that std::numeric_limits has to be specialized for poe::OpCode if you want to use numeric_cast on it. </pre> Ticket