alpaqa
develop
Nonconvex constrained optimization
Loading...
Searching...
No Matches
src
alpaqa
include
alpaqa
util
possible-alias.hpp
Go to the documentation of this file.
1
#pragma once
2
3
#include <type_traits>
4
5
namespace
alpaqa::util
{
6
namespace
detail
{
7
8
/// Check if @p A is equal to any of @p Bs.
9
template
<
class
A,
class
...
Bs
>
10
constexpr
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.
16
template
<
class
...>
17
struct
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.
25
template
<
class
NewAlias
,
class
...
PossibleAliases
>
26
using
possible_alias_t
=
27
std::conditional_t<
detail::any_is_same
<
NewAlias
,
PossibleAliases
...>(),
28
detail::dummy<NewAlias, PossibleAliases...>
,
NewAlias
>;
29
30
}
// namespace alpaqa::util
alpaqa::util::detail::any_is_same
constexpr bool any_is_same()
Check if A is equal to any of Bs.
Definition
possible-alias.hpp:10
alpaqa::util::detail::dummy
Unused unique type tag for template specializations that were rejected because some types were not di...
Definition
possible-alias.hpp:17
alpaqa::util
Definition
check-dim.hpp:8
alpaqa::util::possible_alias_t
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.
Definition
possible-alias.hpp:28
alpaqa::inf
constexpr const auto inf
Definition
config.hpp:112
detail
Definition
results.hpp:127
Generated on Mon May 6 2024 for alpaqa by
1.9.8