#pragma once #include #include namespace std { template struct tuple_size> : std::integral_constant {}; template struct tuple_element<0, Corrade::Containers::Optional> { using type = T; }; template struct tuple_element<1, Corrade::Containers::Optional> { using type = bool; }; } // namespace std namespace Corrade::Containers { template std::tuple_element_t> get(const Optional& value) noexcept(std::is_nothrow_default_constructible_v && std::is_nothrow_copy_constructible_v) { static_assert(N < 2); static_assert(std::is_default_constructible_v && std::is_copy_constructible_v); if constexpr (N == 0) return value ? *value : T{}; if constexpr (N == 1) return bool(value); } } // namespace Corrade::Containers