K
Kleidemos
If I implement a simple RTTI system, more simple than C++ RTTI system
for my program and this system is plus or minus:
#define DEF_RTTI_BASE(name) virtual inline const char *Name(){ return
#name; }
#define DEF_RTTI(name) inline const char *Name(){ return #name; }
And(for example)
class CProva
{
public:
CProva(){};
~CProva(){};
DEF_RTTI_BASE(CProva)
};
class CProvaDerived
{
public:
CProvaDerived(){};
~CProvaDerived(){};
DEF_RTTI(CProvaDerived)
};
int main()
{
CProva p;
CProvaDerived d;
std::cout << "Base: " << p.Name()<< "\n";
std::cout << "Derived: " << d.Name()<< "\n";
char cexit = std::cin.get();
return 0;
}
This system is a valid RTTI subsystem that can subsitute the C++ RTTI
and I can use it in my program without the dipendens of the C++ RTTI system?
--
Tnk
Luca "Kleidemos" Francesca
Un computer a un altro quando si incontrano:
"Ciao, come ti boota oggi???"
for my program and this system is plus or minus:
#define DEF_RTTI_BASE(name) virtual inline const char *Name(){ return
#name; }
#define DEF_RTTI(name) inline const char *Name(){ return #name; }
And(for example)
class CProva
{
public:
CProva(){};
~CProva(){};
DEF_RTTI_BASE(CProva)
};
class CProvaDerived
{
public:
CProvaDerived(){};
~CProvaDerived(){};
DEF_RTTI(CProvaDerived)
};
int main()
{
CProva p;
CProvaDerived d;
std::cout << "Base: " << p.Name()<< "\n";
std::cout << "Derived: " << d.Name()<< "\n";
char cexit = std::cin.get();
return 0;
}
This system is a valid RTTI subsystem that can subsitute the C++ RTTI
and I can use it in my program without the dipendens of the C++ RTTI system?
--
Tnk
Luca "Kleidemos" Francesca
Un computer a un altro quando si incontrano:
"Ciao, come ti boota oggi???"