i've got a question about the void_t metafunction, shown in this video https://www.youtube.com/watch?v=a0FliKwcwXE and the question asked at 41:25.
I'll try to show my question with this code snippet:
template<typename _Tp, typename _Up, typename = void>
class __is_assignable_helper_af2: public std::false_type
{
};
template<typename _Tp, typename _Up>
class __is_assignable_helper_af2<_Tp, _Up,
void_t<decltype(std::declval<_Tp&>() = std::declval<_Up&>())>>
: public std::true_type
{
};
Why does the first template need the default type void ? int doesn't work.
What I understand is that both functions will have the same signature ( with void) but the more spezialized will be used (the second). But why does it not work with int ? The second one with void would still be the prefered one would't it ?
Would the =int not match SFINAE ?
thanks!