开发者

C++ "delayed" template argument

Is there direct way to do the following:

template < class >
stru开发者_开发技巧ct f {};

template < class F >
void function() {
    F<int>();  //for example
    // ? F template <int>();
}

function < f >();

I have workaround by using extra class around template struct. I am wondering if it's possible to do so directly.

Thanks


The proper syntax for template template-parameters is as follows

template < class > struct f {}; 

template < template <class> class F > 
void function() { 
    F<int>();  //for example 
} 

...     
function < f >()
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜