help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Decode output from typeid().name()


From: C.W.Holeman II
Subject: Decode output from typeid().name()
Date: Mon, 16 Feb 2009 15:27:02 -0800
User-agent: Thunderbird 2.0.0.19 (X11/20090105)

Is there a reference that decodes the output from typeid().name()?

----- x.cxx ------
#include <iostream>
#include <typeinfo>
class X {
public:
    template<typename T> X& operator<<(T const& a_v){
        std::cout << typeid(T).name() << std::endl;
    }
};
int main(){
    X x;
    x << "Hello, world!";
    x << 1;
    x << -1.234;
    x << x;
}
-------------------

---- output -----
A14_c
i
d
1X
------------------

--
C.W.Holeman II cwhii5@Julian5Locals.com-5s http://JulianLocals.com/cwhii
 To only a fraction of the  human  race does God  give the  privilege of
 earning one's bread doing what one would have  gladly pursued free, for
 passion. I am very thankful. The Mythical Man-Month Epilogue/F.P.Brooks


reply via email to

[Prev in Thread] Current Thread [Next in Thread]