Strange output std :: typeid :: name ()

I used typeid to get type names std :: vector :: size_type and size zero of class A with the following code ( cppreference ):

 #include<iostream> #include <vector> #include <typeinfo> using namespace std; class A {}; int main() { vector<int> v(10); vector<int>::size_type s = v.size(); A a; cout << typeid(s).name() << endl; cout << typeid(a).name() << endl; }; 

And I got this as a conclusion:

 m 1A 

I assume that “1” to “A” is the result of optimizing an empty base class, but what does “m” mean and is this normal?

I am using the following version of gcc: g ++ (Ubuntu 4.4.3-4ubuntu5.1) 4.4.3

+8
c ++
source share
1 answer

g ++ uses its assigned name definition for types, but also offers the c++filt to make them accessible to humans:

 $ ./test | c++filt -t unsigned long A 
+11
source share

All Articles