101#if TGUI_COMPILED_WITH_CPP_VER >= 17
114 template <
typename T>
116#if TGUI_COMPILED_WITH_CPP_VER >= 17
117 m_variant{std::forward<T>(value)}
119 m_any{std::forward<T>(value)}
129 template <
typename T>
132#if TGUI_COMPILED_WITH_CPP_VER >= 17
133 return std::get<T>(m_variant);
135 return m_any.as<T>();
144 template <
typename T>
145 TGUI_NODISCARD
const T&
get()
const
147#if TGUI_COMPILED_WITH_CPP_VER >= 17
148 return std::get<T>(m_variant);
150 return m_any.as<T>();
160 template <std::size_t Index>
163#if TGUI_COMPILED_WITH_CPP_VER >= 17
164 return std::get<Index>(m_variant);
166 return priv::IndexInEmulatedVariantHelper<FirstType, OtherTypes...>::getByIndex(m_any, Index, 0);
175 template <std::size_t Index>
176 const auto& get() const
178#if TGUI_COMPILED_WITH_CPP_VER >= 17
179 return std::get<Index>(m_variant);
181 return priv::IndexInEmulatedVariantHelper<FirstType, OtherTypes...>::getByIndex(m_any, Index, 0);
188 std::size_t index() const
190#if TGUI_COMPILED_WITH_CPP_VER >= 17
191 return m_variant.index();
193 return priv::IndexInEmulatedVariantHelper<FirstType, OtherTypes...>::findIndex(m_any, 0);
201#if TGUI_COMPILED_WITH_CPP_VER >= 17
202 std::variant<Types...> m_variant;