19 |
|
|
20 |
|
class TypeInfo |
21 |
|
{ |
22 |
< |
public: |
23 |
< |
// Constructors |
24 |
< |
TypeInfo(); // needed for containers |
25 |
< |
TypeInfo(const std::type_info&); // non-explicit |
22 |
> |
public: |
23 |
> |
// Constructors |
24 |
> |
TypeInfo(); // needed for containers |
25 |
> |
TypeInfo(const std::type_info&); // non-explicit |
26 |
|
|
27 |
< |
// Access for the wrapped std::type_info |
28 |
< |
const std::type_info& Get() const; |
29 |
< |
// Compatibility functions |
30 |
< |
bool before(const TypeInfo& rhs) const; |
31 |
< |
const char* name() const; |
27 |
> |
// Access for the wrapped std::type_info |
28 |
> |
const std::type_info& Get() const; |
29 |
> |
// Compatibility functions |
30 |
> |
bool before(const TypeInfo& rhs) const; |
31 |
> |
const char* name() const; |
32 |
|
|
33 |
< |
private: |
34 |
< |
const std::type_info* pInfo_; |
33 |
> |
private: |
34 |
> |
const std::type_info* pInfo_; |
35 |
|
}; |
36 |
|
|
37 |
|
// Implementation |
38 |
|
|
39 |
|
inline TypeInfo::TypeInfo(){ |
40 |
< |
class Nil {}; |
41 |
< |
pInfo_ = &typeid(Nil); |
40 |
> |
class Nil {}; |
41 |
> |
pInfo_ = &typeid(Nil); |
42 |
|
} |
43 |
|
|
44 |
|
inline TypeInfo::TypeInfo(const std::type_info& ti): pInfo_(&ti) |
45 |
|
{ } |
46 |
|
|
47 |
|
inline bool TypeInfo::before(const TypeInfo& rhs) const{ |
48 |
< |
return pInfo_->before(*rhs.pInfo_); |
48 |
> |
return pInfo_->before(*rhs.pInfo_); |
49 |
|
} |
50 |
|
|
51 |
|
inline const std::type_info& TypeInfo::Get() const{ |
52 |
< |
return *pInfo_; |
52 |
> |
return *pInfo_; |
53 |
|
} |
54 |
|
|
55 |
|
inline const char* TypeInfo::name() const{ |
56 |
< |
return pInfo_->name(); |
56 |
> |
return pInfo_->name(); |
57 |
|
} |
58 |
|
|
59 |
|
// Comparison operators |