Code below compiles and run with VS2013 but it does not compile with g++ 4.8.2. Getting 'insert' is ambiguous error message. Spent many hours trying to figure it out but no luck. My guess would be that insert does not like how it's being called.
thanks;
'insert' is ambiguous '
Candidates are:
void insert(__gnu_cxx::__normal_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char>> *,
std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char>>,
std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>>>,
__gnu_cxx::__normal_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char>> *,
std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char>>,
std::allocator<std::basic_string<char,std::char_traits<char>,std::allocator<char>>>>>,
__gnu_cxx::__normal_iterator<std::basic_string<char,std::char_traits<char>,std::allocator<char>> *,
std::vector<std::basic_string<char,std::char_traits<char>,std::allocator<char>>,std::allocator<std::basic_string<char,
std::char_traits<char>,std::allocator<char>>>>>)
1 2 3 4 5 6
|
typedef std::vector<std::string> Filetype;
Filetype myDoc, insertpoint,slice;
Filetype::iterator itx = std::find(myDoc.begin(), myDoc.end(), *(--insertpoint.end()));
++itx;
myDoc.insert(itx, slice.begin(), slice.end());
|