我不明白模板参数之间的区别
template <class T>
class C
{
T t;
};
void foo()
{
C<void ()> c1; //isn't compiled
C<void (*)()> c2;
}
Run Code Online (Sandbox Code Playgroud)
void()的类型是什么?这种类型用于boost :: function ..
void()是一种功能类型.void(*)()是指针类型.在C++中,你不能有功能型的变量,所以T t;当不编译T的void().