GetBoundaryConditionsBase.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <type_traits>
7 
8 #include "Utilities/TypeTraits/CreateHasTypeAlias.hpp"
9 
11 CREATE_HAS_TYPE_ALIAS(boundary_conditions_base)
12 CREATE_HAS_TYPE_ALIAS_V(boundary_conditions_base)
13 
14 namespace detail {
15 // used as passive error message
16 struct TheSystemHasNoBoundaryConditionsBaseTypeAlias {};
17 
18 template <typename T, typename = std::void_t<>>
20  using type = TheSystemHasNoBoundaryConditionsBaseTypeAlias;
21 };
22 
23 template <typename T>
25  T, std::void_t<typename T::boundary_conditions_base>> {
26  using type = typename T::boundary_conditions_base;
27 };
28 } // namespace detail
29 
30 /// Returns `T::boundary_condition_base` or a placeholder class.
31 template <typename T>
33  typename detail::get_boundary_conditions_base<T>::type;
34 } // namespace domain::BoundaryConditions
domain::BoundaryConditions::get_boundary_conditions_base
typename detail::get_boundary_conditions_base< T >::type get_boundary_conditions_base
Returns T::boundary_condition_base or a placeholder class.
Definition: GetBoundaryConditionsBase.hpp:33
CREATE_HAS_TYPE_ALIAS
#define CREATE_HAS_TYPE_ALIAS(ALIAS_NAME)
Generate a type trait to check if a class has a type alias with a particular name,...
Definition: CreateHasTypeAlias.hpp:27
domain::BoundaryConditions
Domain support for applying boundary conditions
Definition: BoundaryCondition.hpp:14
CREATE_HAS_TYPE_ALIAS_V
#define CREATE_HAS_TYPE_ALIAS_V(ALIAS_NAME)
Generate a type trait to check if a class has a type alias with a particular name,...
Definition: CreateHasTypeAlias.hpp:39
type_traits