Consider this c++ code:

#include 
#include 
#include 

using std::vector;
using std::string;

typedef vector StringVec;

void print(const StringVec &string_vec) {
    for (StringVec::iterator it = string_vec.begin(); it != string_vec.end(); it++) {
        std::cout << *it << std::endl;
    }
}

int main(void) {
    vector string_vec;
    string_vec.push_back("hello");
    string_vec.push_back("world");
    print(string_vec);
}

I compiled it on CentOS-5 on which the version of gcc is 4.1.2 in the first place and it report:

test.cpp: In function ‘void print(const StringVec&)’:
test.cpp:11: error: conversion from ‘__gnu_cxx::__normal_iterator, std::allocator >*, std::vector, std::allocator >, std::allocator, std::allocator > > > >’ to non-scalar type ‘__gnu_cxx::__normal_iterator, std::allocator >*, std::vector, std::allocator >, std::allocator, std::allocator > > > >’ requested

Can anyone find out the problem at first glance of this mess report ? The error report of c++ template is terrible difficult to understand, since I used it 9 years ago.
Then I try to compile the source on CentOS-6 with gcc-4.4.6

test.cpp: In function ‘void print(const StringVec&)’:
test.cpp:11: error: conversion from ‘__gnu_cxx::__normal_iterator, std::allocator >*, std::vector, std::allocator >, std::allocator, std::allocator > > > >’ to non-scalar type ‘__gnu_cxx::__normal_iterator, std::allocator >*, std::vector, std::allocator >, std::allocator, std::allocator > > > >’ requested

Looks almost the same. How about CentOS-7 with gcc-4.8.5

test.cpp: In function ‘void print(const StringVec&)’:
test.cpp:11:52: error: conversion from ‘std::vector >::const_iterator {aka __gnu_cxx::__normal_iterator*, std::vector > >}’ to non-scalar type ‘std::vector >::iterator {aka __gnu_cxx::__normal_iterator*, std::vector > >}’ requested
     for (StringVec::iterator it = string_vec.begin(); it != string_vec.end(); it++) {
                                                    ^

Aha, much better as it tell us the exact position of problem: “vec.begin()” will return a “const_iterator” which is not coherent to “iterator”.
To save your time for debugging c++ template code and enjoy life, please update your gcc.