A workaround for partial specialization of function template?

后端 未结 3 778
不思量自难忘°
不思量自难忘° 2020-12-22 07:53

Consider the following metafunction for an integral pow (it is just an example) :

class Meta
{
    template static constexpr T ipow(         


        
3条回答
  •  暖寄归人
    2020-12-22 08:27

    Just use static members in a class template and specialize the class template. You might want to create a forwarding function template for convenience, though.

提交回复
热议问题