- 论坛徽章:
- 0
|
不是我说的,是编译器说的
vc8的报错信息
error C2666: 'std::basic_string<_Elem,_Traits,_Ax>: perator []' : 4 overloads have similar conversions
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Ax=std::allocator<char>
]
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\xstring(1547): could be 'const char &std::basic_string<_Elem,_T
raits,_Ax>: perator [](unsigned int) const'
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Ax=std::allocator<char>
]
C:\Program Files\Microsoft Visual Studio 8\VC\INCLUDE\xstring(1527): or 'char &std::basic_string<_Elem,_Traits,_Ax>::
operator [](unsigned int)'
with
[
_Elem=char,
_Traits=std::char_traits<char>,
_Ax=std::allocator<char>
]
or 'built-in C++ operator[(const char *, int)'
or 'built-in C++ operator[(char *, int)'
while trying to match the argument list '(B, int)'
MSDN中关于 C2666 的解释
编译器错误 C2666
错误消息
“identifier”: number 个重载有相似的转换
重载函数或运算符不明确。形参列表可能太相似,编译器无法解析多义性。若要消除此错误,请显式强制转换一个或多个实参。 |
|