59 operator const T&()
const
61 if (
typeid(T) != type())
63 return *
static_cast<const T*
>(ptr());
66 bool is()
const {
return typeid(T) == type(); }
70 virtual const std::type_info& type()
const = 0;
71 virtual const void* ptr()
const = 0;
83 virtual const std::type_info& type()
const {
return typeid(T); }
84 virtual const void* ptr()
const {
return &iRef; }
104 template <
typename T>
107 if (
typeid(T) != type())
109 return *
static_cast<T*
>(ptr());
111 template <
typename T>
112 bool is()
const {
return typeid(T) == type(); }
117 virtual const std::type_info& type()
const = 0;
118 virtual void* ptr()
const = 0;
121 template <
typename T>
130 virtual any_const_ref_holder_base* const_clone(
void* aWhere)
const {
return new (aWhere) any_const_ref_holder<T>(
const_cast<const T&
>(iRef)); }
131 virtual const std::type_info& type()
const {
return typeid(T); }
132 virtual void* ptr()
const {
return &iRef; }
144 template <
typename T>
153 iHolder = aOther.iHolder->
clone(iSpace.iBytes);
158 template <
typename T>
160 template <
typename T>
161 bool is()
const {
return iHolder && iHolder->
is<T>(); }
183 template <
typename T>
193 iHolder = aOther.iHolder->
clone(iSpace.iBytes);
198 template <
typename T>
200 template <
typename T>
201 bool is()
const {
return iHolder && iHolder->
is<T>(); }
virtual ~any_const_ref_holder_base()=default
virtual any_const_ref_holder_base * clone(void *aWhere) const =0
any_const_ref_holder(const T &aRef)
any_const_ref(const any_ref &aOther)
any_const_ref(const any_const_ref &aOther)
any_const_ref(const T &aObject)
any_const_ref & operator=(const any_const_ref &aOther)
char iBytes[sizeof(any_const_ref_holder< char >)]
any_const_ref(any_const_ref &aOther)
virtual any_const_ref_holder_base * const_clone(void *aWhere) const =0
virtual ~any_ref_holder_base()=default
virtual any_ref_holder_base * clone(void *aWhere) const =0
any_ref(const any_ref &aOther)
any_ref & operator=(const any_ref &aOther)
char iBytes[sizeof(any_ref_holder< char >)]