SFINAE tried with bool gives compiler error: “template argument ‘T::value’ involves template parameter” [duplicate]

Actually what you’re doing is forbidden by section §14.5.4/9 which says, A partially specialized non-type argument expression shall not involve a template parameter of the partial specialization except when the argument expression is a simple identifier. The trick could be using a type for second template parameter as well, encapsulating the non-type value, as described … Read more

Assert that code does NOT compile

template<class T>struct sink{typedef void type;}; template<class T>using sink_t=typename sink<T>::type; template<typename T, typename=void>struct my_test:std::false_type{}; template<typename T>struct my_test<T, sink_t<decltype( put code here. Note that it must “fail early”, ie in the signature of a function, not in the body )> >:std::true_type {}; The above generates a test if the “put code here” can be evaluated. To determine … Read more

“Are you missing an assembly reference?” compile error – Visual Studio

In my case it was a project defined using Target Framework: “.NET Framework 4.0 Client Profile ” that tried to reference dll projects defined using Target Framework: “.NET Framework 4.0”. Once I changed the project settings to use Target Framework: “.NET Framework 4.0” everything was built nicely. Right Click the project->Properties->Application->Target Framework

Android resource IDs suddenly not final, switch()’es broken

This happened about yesterday, when the SDK/ADT 14 got released: As of ADT 14, resource constants in library projects are no longer final. This is explained in greater detail in http://tools.android.com/tips/non-constant-fields There’s a quickfix available from ADT 14: http://tools.android.com/recent/switchstatementconversion To quote from the rationale: When multiple library projects are combined, the actual values of the … Read more