Odd string returned from typeid

I'm developing a template function that takes in containers as a parameter. The function will use typeid to check if a container was passed in or not. Since I've never used typeid before, I played around with it but got strange results.

Returns a null-terminated character sequence that may identify the type.
The particular representation pointed by the returned value is implementation-defined, and may or may not be different for different types.

Returns an implementation defined null-terminated character string containing the name of the type. No guarantees are given, in particular, the returned string can be identical for several types and change between invocations of the same program.

Also he have used conditional compilation to make sure that code will compile on all compilers (however on compilers different from GCC it will not change anything: you still get type name in whatever format that compiler uses)

The function will use typeid to check if a container was passed in or not

I want to point that your code will not work with user defined containers (If I create class MyCoolStack which satisfies all requirements to containers it will probably be not accepted by your function). In C++14 there will be Constraints which will work with user defined types and can do exactly what you want. (I am not saying that you should drop what you doing now and wait for C++14, just telling you some information)

In the snippet posted earlier, boost spirit was used for convenience. Checking if a type meets the requirement of a container involves many checks (in addition to 'does the type define a 'const_iterator'?); and the library had already implemented those checks.