Questions tagged «variable-templates»

1
可以将变量模板作为模板模板参数传递吗?
以下荒谬的示例无法编译,但是还有其他方法可以将变量模板作为模板模板参数传递吗? template<typename T> constexpr auto zero = T{0}; template<typename T, template<typename> auto VariableTemplate> constexpr auto add_one() { return VariableTemplate<T> + T{1}; } int main() { return add_one<int, zero>(); } 尝试编译器资源管理器
By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.