<div class="gmail_quote">2010/12/14 Igor R <span dir="ltr"><<a href="mailto:boost.lists@gmail.com">boost.lists@gmail.com</a>></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 "error<br> C2893: Failed to specialize function template..."<br> It seems that the compiler tries to evaluate mpl::apply, doesn't it?<br> <br> <br> #include <boost/mpl/apply.hpp><br> #include <boost/mpl/bool.hpp><br> #include <boost/mpl/or.hpp><br> #include <boost/mpl/and.hpp><br> #include <boost/mpl/always.hpp><br> #include <boost/type_traits/is_same.hpp><br> #include <boost/utility/enable_if.hpp><br> <br> using namespace boost::mpl;<br> using boost::is_same;<br> <br> template<typename Type><br> void test(Type,<br> �typename boost::enable_if<br> �<<br> � �and_<br> � �<<br> � � �not_<boost::is_same<Type, int> >,<br> � � �apply<always<true_>, typename Type::my_type><br> � �><br> �>::type* dummy = 0)<br> {<br> }<br> <br> template<typename Type><br> void test(Type,<br> �typename boost::disable_if<br> �<<br> � �and_<br> � �<<br> � � �not_<boost::is_same<Type, int> >,<br> � � �apply<always<true_>, typename Type::my_type><br> � �><br> �>::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't have a nested type my_type. <br><br>Under mingw-4.5 I get:<br>error: no matching function for call to 'test(int)'<br> <br>Regards,<br>Kris<br>