Member function template with the number of parameters depending on an integral template parameter

前端 未结 4 496
闹比i
闹比i 2021-02-04 10:27

I have the following class template:

template
class MyClass;

where T is some type, N - num

4条回答
  •  孤独总比滥情好
    2021-02-04 10:49

    Your third variant's second non-type param should have prefix typename not class :

    template::type = 0>
    void foo(T2... args);
    ..
    foo(1,2,3);
    

    Check it

    Gcc 4.7.0 snapshots has some bugs with templates I guess, if you try it with gcc 4.6.2/1 it shall work.

提交回复
热议问题