std::enable_if 和 std::enable_if_t 有什么区别?

ter*_*rth 7 c++ templates stl enable-if

C++-14 引入std::enable_if_t.

它 和 和有什么不一样std::enable_if?使用上有什么优点或者区别吗std::enable_if_t

Yam*_*ari 8

std::enable_if_t 是 std::enable_if 的内部 ::type 的类型别名,它是语法糖,因此您不必编写

typename std::enable_if</* */>::type
Run Code Online (Sandbox Code Playgroud)