void_t in parameter list works but not as return type

拥有回忆 提交于 2019-12-05 13:39:22
template<class...>struct voider{using type=void;};
template<class...Ts>using void_t=typename voider<Ts...>::type;

there is an ambiguity in the C++11 standard about whether non-used template parameters to template using aliases that are invalid types/expressions are a substitution failure or not.

gcc and clang interpreted the clause differently, which is what I think you are seeing. The above void_t should make it work the same in both gcc and clang.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!