specialize a member template without specializing its parent

前端 未结 4 1039
孤街浪徒
孤街浪徒 2020-12-17 20:56

I have a class template nested inside another template. Partially specializing it is easy: I just declare another template< … > block inside its parent.

4条回答
  •  盖世英雄少女心
    2020-12-17 21:20

    It is illegal under C++ standard 14.7.3/18:

    .... the declaration shall not explicitly specialize a class member template if its enclosing class templates are not explicitly specialized as well.

提交回复
热议问题