I'm trying to understand how enable_if works and I understand almost everything except scenario #3 from
https://en.cppreference.com/w/cpp/types/enable_if
template<class T>
void destroy(T* t,
typename
std::enable_if<std::is_trivially_destructible<T>::value>::type* = 0)
{
std::cout << "destroying trivially destructible T
";
}
if the expression in enable_if is true then partial template specialization is chosen, so if it is chosen:
- why in enable_if is only condition without indicating second template parameter ?
- What type is "type*" then ? void* ? if so, why ?
- Why is it pointer ?