实际上我用intel编译器编译一些库时遇到了问题.
使用g ++正确编译了相同的库.
问题是由模板引起的.我想要理解的是
**typename**函数体内的模板函数参数和变量声明的声明
例:
void func(typename sometype){..
...
typename some_other_type;
..
}
Run Code Online (Sandbox Code Playgroud)
编译这种代码产生以下错误(英特尔),(gcc没有声称):我有以下错误
../../../libs/log/src/attribute_set.cpp(415): error: no operator "!=" matches these operands
operand types are: boost::log_st::basic_attribute_set<wchar_t>::iter<'\000'> != boost::log_st::basic_attribute_set<wchar_t>::iter<'\000'>
while (begin != end)
^
detected during instantiation of "void boost::log_st::basic_attribute_set<CharT>::erase(boost::log_st::basic_attribute_set<CharT>::iter<'\000'>, boost::log_st::basic_attribute_set<CharT>::iter<'\000'>) [with CharT=wchar_t]" at line 438
../../../boost/log/attributes/attribute_set.hpp(115): error: no operator "!=" matches these operands
operand types are: boost::log_st::basic_attribute_set<wchar_t>::iter<'\000'> != boost::log_st::basic_attribute_set<wchar_t>::iter<'\000'>
if (it != m_pContainer->end())
Run Code Online (Sandbox Code Playgroud)
我想要理解的是在函数体内使用typename,参数声明.
例:
template< typename CharT >
struct basic_attribute_values_view< CharT >::implementation
{
public:
..
..
void …Run Code Online (Sandbox Code Playgroud)