Attempting to use std::enable_if_t in the template parameters gives an error

doesn’t name a type

, although type_traits connected, standard 11. What could be the problem?

  • If you are given an exhaustive answer, mark it as correct (a daw opposite the selected answer). - Nicolas Chabanovsky

1 answer 1

std::enable_if_t is from C ++ 14, in C ++ 11 there is only std::enable_if<C, T>::type

However, enable_if_t is an alias and you can write it yourself:

 template<bool C, class T = void> using enable_if_t = typename std::enable_if<C, T>::type; 
  • And how can the equivalent be replaced? - kirill
  • @kirill enable_if is the equivalent. - Abyx