April 20th, 2007
C-Plus-Plus
It is amaising what horrorable error messages g++ is able to generate…
error: could not convert ‘((Parser*)this)->Parser::words. std::map<_Key, _Tp, _Compare, _Alloc>::find [with _Key = std::basic_string<char, std::char_traits<char>, std::allocator<char> >, _Tp = Word*, _Compare = std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, _Alloc = std::allocator<std::pair<const std::basic_string<char, std::char_traits<char>, std::allocator<char> >, Word*> >](((const std::basic_string<char, std::char_traits<char>, std::allocator<char> >&)((const std::basic_string<char, std::char_traits<char>, std::allocator<char> >*)(& sval))))’ to ‘bool’
The code to reproduce it looks like
if (words.find(sval)) {...}
where words is a std::map<std::string, Word*>
.
The correct code is:
if (words.find(sval) == words.end()) {...}
I dont get a single word of it although i guess im supposed to be…
Well, if you would like to be supposed… 😉
It happened while developing the Parametrisierte Datentypen in der Programmierung-software. As you don’t attend to this course – you don’t have to be supposed.
i see. “glück gehabt…”