开发者

How do I define a template function within a template class outside of the class definition?

开发者 https://www.devze.com 2023-02-13 10:25 出处:网络
Given:开发者_运维知识库 template <class T> class Foo { public: template <class U> void bar();

Given:

开发者_运维知识库
template <class T>
class Foo
{
public:
    template <class U>
    void bar();
};

How do I implement bar outside of the class definition while still having access to both template parameters T and U?


IIRC:

template<class T> template <class U>
void Foo<T>::bar() { ...
0

精彩评论

暂无评论...
验证码 换一张
取 消