错误:"<"令牌之前的预期初始值设定项 |全球
error: expected initializer before '<' token | global
我有一个类的模板,像这样:
template <template <class, class> class ContainerType>
并且在private字段中设置了一些全局函数和静态函数。
我在类之外实现了我的这些函数,在任何函数之前我声明模板
template <template <class, class> class ContainerType>
但是对于这样一个函数,我得到了这个错误:
错误:'<'标记前期望初始化项
template<template<class, class> class ContainerType>
void Book<ContainerType>::listCopier(const List_to_copy<ContainerType>& that)
{
if(mylist.begin() != mylist.end())
std::for_each(mylist.begin(), mylist.end(), DeleteLIST());
_this = this;
std::for_each(that.mylist.begin(), that.mylist.end(), myAllocator);
}
它可以是什么,我如何解决它!?
Try
template<template<class, class> class ContainerType>
void Book::listCopier(const List_to_copy<ContainerType>& that)
{ ... }
相关文章:
- 请解释这句话(cout<<1+int((a<b)^((b-a)&1) )<<endl
- 呼叫运营商<<临时
- 如何防止clang格式在流运算符调用之间添加换行符<<
- <<操作员在下面的行中工作
- 包括STL,而不会乱扔全球范围
- 如何显式调用运算符<<
- 全球免费给出一个错误.调试器不解释
- 全球宣布时内存泄露?
- 将元素添加到结构向量的全球向量中
- 模板操作员&lt;未打电话
- C / CUDA中的模板方法是3个角括号(&lt;&lt;&lt;)
- 未使用全球的静态初始化器
- 无痛地改变全球视体的类型
- 在现代CMAKE中设置全球选项
- C - 创建矢量&lt; vector&lt; double&gt;&gt;矩阵具有分配而不是inizializ
- 错误:调用"std::vector<:vector<int>>::p ush_back(std::vector<std::__cxx11::basic_string<
- C 建造者Clang STD :: Sill,找不到超载的操作员&lt;
- 为什么STD :: MAP需要操作员&lt;以及我如何写一个
- 以编程方式设置全球环境变量
- 将全球枚举的全局枚举更改为函数中的int值