39 using StorageType =
typename std::decay<T>::type;
43 return ptr ==
nullptr;
48 return ptr !=
nullptr;
53 : ptr{
new Derived<StorageType<U>>(std::forward<U>(value))}
60 typedef StorageType<U> T;
61 return (
dynamic_cast<Derived<T>*
>(ptr) !=
nullptr);
65 StorageType<U>& as()
const
67 typedef StorageType<U> T;
68 auto derived =
dynamic_cast<Derived<T>*
>(ptr);
70 throw std::bad_cast();
72 return derived->value;
78 return as<StorageType<U>>();
97 Any& operator=(
const Any& a)
112 Any& operator=(
Any&& a)
noexcept
117 std::swap(ptr, a.ptr);
131 virtual Base* clone()
const = 0;
135 struct Derived : Base
139 value(std::forward<U>(val))
143 Base* clone()
const override
145 return new Derived<T>(value);
Namespace that contains all TGUI functions and classes.
Definition: AbsoluteOrRelativeValue.hpp:37