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

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

        
4条回答
  •  囚心锁ツ
    2020-11-29 04:06

    You can work around this behavior by delegating the real work to another structure though:

    namespace detail
    {
      template 
      struct InnerImpl {};
    }
    
    template 
    struct Outer
    {
      template 
      struct Inner: detail::InnerImpl
      {
      };
    };
    

    Now you can specialize InnerImpl as you wish

提交回复
热议问题