阅读背景:

为什么允许嵌套类模板的部分专门化,而不允许完整?

来源:互联网 
    template<int x> struct A {                                                                                                    
        template<int y> struct B {};.                                                                                             
        template<int y, int unused> struct C {};                                                                                  
    };                                                                                                                            

    template<int x> template<> 
    struct A<x>::B<x> {}; // error: enclosing class templates are not explicitly specialized

    template<int x> template<int unused> 
    struct A<x>::C<x, unused> {}; // ok
    template<int x> struct A {                 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: