gpt4 book ai didi

c++ - 错误 : expected initializer before '<' token | global

转载 作者:行者123 更新时间:2023-11-28 02:26:39 25 4
gpt4 key购买 nike

我有一个带有这样模板的类:

template <template <class, class> class ContainerType>

我在私有(private)字段中设置了一些全局函数和静态..

我在类之外实现了我的这些功能,并且在我声明模板的任何功能之前

template <template <class, class> class ContainerType>

但是对于所有这样的函数我得到这个错误:

error: expected initializer before '<' token

    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);
}

它可能是什么以及我如何解决它!?

最佳答案

尝试

 template<template<class, class> class ContainerType>
void Book::listCopier(const List_to_copy<ContainerType>& that)
{ ... }

关于c++ - 错误 : expected initializer before '<' token | global,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30415721/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com