首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >双template<>语句

双template<>语句
EN

Stack Overflow用户
提问于 2011-10-17 21:08:34
回答 3查看 2.6K关注 0票数 19

这里有这样的函数定义:

代码语言:javascript
运行
复制
template<>
template<>
void object::test<1>()
{
}

有两个template<>是什么意思?

编辑:

我提取了对此示例有效的代码:

代码语言:javascript
运行
复制
#include <iostream>

template <class U>
class A {

    template <int n>
    void test() {

    }
};

template <class T>
class B {
public:
    typedef A<T> object;
};

typedef B<int>::object object;

template<>
template<>
void object::test < 1 > () {
}

int main() {
    return 0;
} 

此代码在g++下编译。

来源:TUT test framework

EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/7794207

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档