Can I partially specialize a template with a pattern like foo?

前端 未结 2 501
误落风尘
误落风尘 2021-01-12 18:07

If this is possible, one can index into a variadic template parameter pack without recursion. However, GCC is refusing to pick up my partial specialization here:

<         


        
2条回答
  •  时光取名叫无心
    2021-01-12 18:21

    The spec says at 14.8.2.5p9

    If P has a form that contains or , then each argument Pi of the respective template argument list P is compared with the corresponding argument Ai of the corresponding template argument list of A. If the template argument list of P contains a pack expansion that is not the last template argument, the entire template argument list is a non-deduced context.

    Your typelist unfortunately matches that pattern.

提交回复
热议问题