<div class="gmail_quote">2010/12/14 Igor R <span dir="ltr">&lt;<a href="mailto:boost.lists@gmail.com">boost.lists@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Hello,<br>
<br>
The following code fails to compile (MSVC10, Boost 1.45) with &quot;error<br>
C2893: Failed to specialize function template...&quot;<br>
It seems that the compiler tries to evaluate mpl::apply, doesn&#39;t it?<br>
<br>
<br>
#include &lt;boost/mpl/apply.hpp&gt;<br>
#include &lt;boost/mpl/bool.hpp&gt;<br>
#include &lt;boost/mpl/or.hpp&gt;<br>
#include &lt;boost/mpl/and.hpp&gt;<br>
#include &lt;boost/mpl/always.hpp&gt;<br>
#include &lt;boost/type_traits/is_same.hpp&gt;<br>
#include &lt;boost/utility/enable_if.hpp&gt;<br>
<br>
using namespace boost::mpl;<br>
using boost::is_same;<br>
<br>
template&lt;typename Type&gt;<br>
void test(Type,<br>
 �typename boost::enable_if<br>
 �&lt;<br>
 � �and_<br>
 � �&lt;<br>
 � � �not_&lt;boost::is_same&lt;Type, int&gt; &gt;,<br>
 � � �apply&lt;always&lt;true_&gt;, typename Type::my_type&gt;<br>
 � �&gt;<br>
 �&gt;::type* dummy = 0)<br>
{<br>
}<br>
<br>
template&lt;typename Type&gt;<br>
void test(Type,<br>
 �typename boost::disable_if<br>
 �&lt;<br>
 � �and_<br>
 � �&lt;<br>
 � � �not_&lt;boost::is_same&lt;Type, int&gt; &gt;,<br>
 � � �apply&lt;always&lt;true_&gt;, typename Type::my_type&gt;<br>
 � �&gt;<br>
 �&gt;::type* dummy = 0)<br>
{<br>
}<br>
<br>
int main(int argc, char* argv[])<br>
{<br>
 �test(int());<br>
 �return 0;<br>
}<br></blockquote></div><br>I thing sfinae should disable the above test() functions for every Type, that doesn&#39;t have a nested type my_type. <br><br>Under mingw-4.5 I get:<br>error: no matching function for call to &#39;test(int)&#39;<br>
<br>Regards,<br>Kris<br>