Is sizeof… allowed in template arguments for specialization?

后端 未结 1 668
北荒
北荒 2021-01-03 06:51

I\'m trying to do something along the lines of this using GCC 4.7 snapshot:

template 
struct foo { 
  static const int value = 0;
};
         


        
相关标签:
1条回答
  • 2021-01-03 07:15

    I'm going to assume this is a compiler issue after reading this post.

    A partially specialized non-type argument expression shall not involve a template parameter of the partial specialization except when the argument expression is a simple identifier.

    Which is being disputed here.

    GCC is either incorrectly unpacking the parameter pack, or evaluating sizeof prematurely.

    Response to bug report I filed may be helpful.

    0 讨论(0)
提交回复
热议问题