带运算符">>"的typedef是什么意思?

Gab*_*iel 0 c++ templates

C++中的这个陈述是什么意思.我通过阅读类型列表来看到.

我不明白运算符">"在类型列表中的含义是什么?到目前为止,我从未在C++模板中使用过这个东西?

template 
struct typelist
{
    typedef H head;
    typedef T tail;
};


typedef typelist > >
    floating_point_types;
Run Code Online (Sandbox Code Playgroud)

谢谢你的一些简短解释!¿这是可变参数模板吗?

Die*_*ühl 5

代码片段看起来不对.从名称和上下文我它的意思是这样的:

template <typename H, typename T>
struct typelist
{
    typedef H head;
    typedef T tail;
};


typedef typelist<float, typelist<double, long double> >
    floating_point_types;
Run Code Online (Sandbox Code Playgroud)

原始代码就好像它被粘贴到HTML文档中一样,因此删除了"<...>"序列.

当然,使用C++ 2011,我们不需要做这样的事情.我们可以只使用可变参数模板:

template <typename... T> struct typelist {};

typedef typelist<float, double, long double> floating_point_types;
Run Code Online (Sandbox Code Playgroud)