35 META::is_move_constructible<T>()
41 META::is_copy_constructible<T>()
49 return static_cast<U
>(this->value);
66 std::unique_ptr<details::__any_base>
impl;
72 const std::type_info*
ti;
85 Any& operator=(
Any&&) =
default;
89 Any& operator=(
const Any&) =
delete;
100 this->ti = &
typeid(T);
112 return this->ti->hash_code() ==
typeid(U).hash_code();
123 if(this->canCastTo<U>())
Global namespace of the SCL.
Exception class used when attempting to cast an Any to the wrong type.
__any__impl(const T &value)
U as() const
Attempts to cast this Any.
Any(T &&value)
Move a value into an Any.
Class that can hold any value type (and change value type mid lifetime)
void polymorphism() const final
Any & operator=(T &&value)
Assign a new value to this Any.
const std::type_info * ti
The type_info of the current value type.
bool canCastTo() const
Safely determines whether or not you can cast from the current value type to the one given as argumen...
virtual void polymorphism() const =0
std::unique_ptr< details::__any_base > impl
A PIMPL.