gpt4 book ai didi

c++ - 模板的模板 typedef

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:02:56 24 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
C++ template typedef

我正在尝试通过另一个模板的预特化来派生另一个模板的模板类型:

template<unsigned a, unsigned b, unsigned c>
struct test
{
enum
{
TEST_X = a,
TEST_Y = b,
TEST_Z = c,
};
};

template<unsigned c>
typedef test<0, 1, c> test01;

但是,在 GCC 4.4.5 上,我收到此错误:error: template declaration of 'typedef' on the second type (test01)。

非常感谢您的指导,因为我不明白我的代码有什么问题。

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com