With a vector defined as std::vector<std::string> , consider why the following is true:
if ( vecMetaData[0] != "Some string" ) { ...
But not this:
switch ( vecMetaData[1] ) { ...
Visual Studio complains:
error C2450: expression expression like 'std :: basic_string <_Elem, _Traits, _Ax>' is illegal 1> with 1> [1> _Elem = char, 1> _Traits = std :: char_traits, 1> _Ax = std :: allocator 1>] 1> A user transformation operator is available that can perform this conversion, or the operator cannot be called
source share