开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜