From 38b5c32b1037602068285dc3ad906cc7b94cdcb4 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 3 Dec 2022 08:18:55 +0100 Subject: kill compat/optional --- compat/optional.hpp | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 compat/optional.hpp (limited to 'compat') diff --git a/compat/optional.hpp b/compat/optional.hpp deleted file mode 100644 index 6f8a1a89..00000000 --- a/compat/optional.hpp +++ /dev/null @@ -1,25 +0,0 @@ -#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 -- cgit v1.2.3