tetl 0.1.0
Embedded Template Library
Loading...
Searching...
No Matches
variant_alternative_selector.hpp
Go to the documentation of this file.
1// SPDX-License-Identifier: BSL-1.0
2
3#ifndef TETL_VARIANT_VARIANT_ALTERNATIVE_SELECTOR_HPP
4#define TETL_VARIANT_VARIANT_ALTERNATIVE_SELECTOR_HPP
5
8
9namespace etl::detail {
10
11template <typename T>
12struct variant_alternative_selector_single {
13 auto operator()(T /*t*/) const -> T;
14};
15
16template <typename... Ts>
17inline constexpr auto variant_alternative_selector = etl::overload{variant_alternative_selector_single<Ts>{}...};
18
19template <typename T, typename... Ts>
20using variant_alternative_selector_t = decltype(variant_alternative_selector<Ts...>(etl::declval<T>()));
21
22} // namespace etl::detail
23
24#endif // TETL_VARIANT_VARIANT_ALTERNATIVE_SELECTOR_HPP
auto declval() noexcept -> add_rvalue_reference_t< T >
overload(Functor...) -> overload< Functor... >