ALL,
I'm working on the project which involves heavy usage of STL and its cross-platform. On Windows I'm using MSVC 2010 Pro and on the Mac side I have XCode 4.2 on top of Snow Leopard.
My code looks like this:
m_sort.m_type.size() == 0 ? m_sort.m_type.push_back( SortObject( SORT_BY_NAME, true ) ) : m_sort.m_type.insert( it - 1, SortObject( SORT_BY_NAME, true ) );
where m_sort.m_type is std::vector<> which will be used for sorting another std::vector<>.
Visual Studio compiles this code fine: no warnings, no errors. However, trying to compile this code on XCode I'm getting this error:
Left operand to ? is void, but right operand is of type 'iterator' (aka '__normal_iterator')
Is there an easy way to resolve an error on Mac? And why this code was built successfully on Windows? Or maybe its a difference in STL implementation on XCode for SL vs MSVC on Windows?
Thank you.