我想实例化一个模板externaly但是我想o在实例化子句中使用typedef。我认为例子说,超过一千字:C++ extern模板实例化和typedef(gcc)
typedef myTemplate_base<commonValue> myTemplate; //in 99% of the cases I use this so I want a shorthand
extern template class myTemplate; //wont work/compiler error class infront of typedef
我得到同样的错误,如果我尝试实际实例化这样的模板:
template class myTemplate;
我知道我可以写(extern) template class myTemplate_base<commonValue>
代替,但是我认为这很丑陋,因为我需要在三个地方而不是一个地方调整我的共同价值。
那么我该如何把这个,在extern声明/实例化中使用typedef?
我对Ubunutu
所以你的问题是...你认为C++语法是丑陋的?告诉我们一些我们不知道的东西... – 2011-12-20 00:46:08
不要喂巨魔... 好吧,我认为它是非常好/功能,但我想知道我不能从typedefs实例化,多数民众赞成在所有。 – ted 2011-12-20 01:31:22