| 223 | // otherwise. |
| 224 | template <typename T> |
| 225 | T* get() { |
| 226 | const TypeIndex TTypeIndex = MakeTypeIndex<T>(); |
| 227 | if (is_empty() || (TTypeIndex != TypeId())) return nullptr; |
| 228 | return std::addressof(static_cast<Variant::Value<T>*>(GetValue())->value); |
| 229 | } |
| 230 | |
| 231 | // Returns a pointer to the stored value if it is type T, or nullptr |
| 232 | // otherwise. |