alpaqa 1.0.0a17
Nonconvex constrained optimization
Loading...
Searching...
No Matches
possible-alias.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <type_traits>
4
5namespace alpaqa::util {
6namespace detail {
7
8/// Check if @p A is equal to any of @p Bs.
9template <class A, class... Bs>
10constexpr bool any_is_same() {
11 return (std::is_same_v<A, Bs> || ...);
12}
13
14/// Unused unique type tag for template specializations that were rejected
15/// because some types were not distinct.
16template <class...>
17struct dummy;
18
19} // namespace detail
20
21/// If @p NewAlias is not the same type as any of @p PossibleAliases, the result
22/// is @p NewAlias. If @p NewAlias is not distinct from @p PossibleAliases, the
23/// result is a dummy type, uniquely determined by @p NewAlias and
24/// @p PossibleAliases.
25template <class NewAlias, class... PossibleAliases>
27 std::conditional_t<detail::any_is_same<NewAlias, PossibleAliases...>(),
29
30} // namespace alpaqa::util
constexpr bool any_is_same()
Check if A is equal to any of Bs.
Unused unique type tag for template specializations that were rejected because some types were not di...
std::conditional_t< detail::any_is_same< NewAlias, PossibleAliases... >(), detail::dummy< NewAlias, PossibleAliases... >, NewAlias > possible_alias_t
If NewAlias is not the same type as any of PossibleAliases, the result is NewAlias.
constexpr const auto inf
Definition config.hpp:112