Boost C++ Libraries: Ticket #1216: problems compiling template class using is_class and is_arithmetic https://svn.boost.org/trac10/ticket/1216 <p> Consider this code: </p> <pre class="wiki">class C { public: template &lt;typename T&gt; typename boost::enable_if_c&lt;boost::is_class&lt;T&gt;::value, void&gt;::type f(T&amp; t) { } template &lt;typename T&gt; typename boost::enable_if_c&lt;boost::is_arithmetic&lt;T&gt;::value, void&gt;::type f(T&amp; t) { } }; void main() { C c; } </pre><p> it compiles without fault, but the following code: </p> <pre class="wiki">class A {}; template &lt;class T1&gt; class B : public T1 { public: template &lt;typename T2&gt; typename boost::enable_if_c&lt;boost::is_class&lt;T2&gt;::value, void&gt;::type f(T2&amp; t) { } template &lt;typename T2&gt; typename boost::enable_if_c&lt;boost::is_arithmetic&lt;T2&gt;::value, void&gt;::type f(T2&amp; t) { } }; void main() { B&lt;A&gt; a; } </pre><p> fails to compile </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1216 Trac 1.4.3 John Maddock Mon, 10 Sep 2007 09:56:04 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1216#comment:1 https://svn.boost.org/trac10/ticket/1216#comment:1 <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> <p> That needs to be: </p> <p> template &lt;class T1&gt; class B : public T1 { public: </p> <blockquote> <p> template &lt;typename T2&gt; typename boost::enable_if&lt;boost::is_class&lt;T2&gt;, void&gt;::type f(T2&amp; t) { </p> </blockquote> <blockquote> <p> } </p> </blockquote> <blockquote> <p> template &lt;typename T2&gt; typename boost::enable_if&lt;boost::is_arithmetic&lt;T2&gt;, void&gt;::type f(T2&amp; t) { </p> </blockquote> <blockquote> <p> } </p> </blockquote> <p> }; </p> Ticket