Clang错误:使用'模板'将X视为依赖模板名称的关键字

时间:2018-05-04 09:22:42

标签: c++ c++11 templates clang

我使用的是Clang 3.4.2。在查看此处提供的解决方案时:

Shared memory Vectors in boost with

该行:

typedef basic_string<char, std::char_traits<char>, salloc::rebind<char>::other> shared_string;

给我错误:

error: use 'template' keyword to treat 'rebind' as a dependent template name
    typedef basic_string<char, std::char_traits<char>, salloc::rebind<char>::other> shared_string;

我试过了:

typedef basic_string<char, std::char_traits<char>, salloc::template rebind<char>::other> shared_string;

甚至:

typedef basic_string<char, std::char_traits<char>, template salloc::rebind<char>::other> shared_string;

但我仍然得到错误。

有人可以帮助纠正我吗?

0 个答案:

没有答案