Why is partial specialization of a nested class template allowed, while complete isn't?

后端 未结 4 2071
遇见更好的自我
遇见更好的自我 2020-11-29 03:10
    template struct A {                                                                                                    
        template

        
4条回答
  •  执念已碎
    2020-11-29 04:00

    C++ Standard explicitly prohibits full specialization of member template classes in first case. According to 14.7.3/18:

    In an explicit specialization declaration for a member of a class template or a member template that appears in namespace scope, the member template and some of its enclosing class templates may remain unspecialized, except that the declaration shall not explicitly specialize a class member template if its enclosing class templates are not explicitly specialized as well.

提交回复
热议问题