2013/10/7 Gavin Lambert
On 10/7/2013 9:41 AM, Quoth 山本賢一:
template <class T>
struct always_true : boost::mpl::true_ { };
[...]
Does the behaviour change if you make always_true not a template, or if you make some member of it actually depend on the template argument?
The behaviour changed and the code compiled if I changed always_true not a template. struct always_true : boost::mpl::true_ { }; template <class T> inline typename boost::enable_if_c< !boost::mpl::not_< always_true >::type::value , int
::type get_one(T) { return 1; }
The behaviour didn't change and the code didn't compile if I made some member of always_true actually depend on the template argument. template <class T> struct always_true : boost::mpl::true_ { typedef typename boost::add_const<T>::type unused_type; }; The actual condition to reproduce the issue seems very complex. My best guess is that msvc11 gives up resolving template-parameter-dependent condition and marks it as failure (in the sense of SFINAE) under a specific circumstance.