TypeTraits.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 "PointwiseFunctions/AnalyticData/AnalyticData.hpp"
9 #include "PointwiseFunctions/AnalyticSolutions/AnalyticSolution.hpp"
10 #include "Utilities/TypeTraits.hpp"
11 
12 namespace evolution {
13 // note that std::is_convertible is used in the following type aliases as it
14 // will not match private base classes (unlike std::is_base_of) and some
15 // analytic data privately inherits from an analytic solution
16 
17 /// \ingroup AnalyticDataGroup
18 template <typename T>
19 using is_analytic_data = typename std::is_convertible<T*, MarkAsAnalyticData*>;
20 
21 /// \ingroup AnalyticDataGroup
22 template <typename T>
23 constexpr bool is_analytic_data_v =
24  cpp17::is_convertible_v<T*, MarkAsAnalyticData*>;
25 
26 /// \ingroup AnalyticSolutionsGroup
27 template <typename T>
28 using is_analytic_solution =
30 
31 /// \ingroup AnalyticSolutionsGroup
32 template <typename T>
33 constexpr bool is_analytic_solution_v =
34  cpp17::is_convertible_v<T*, MarkAsAnalyticSolution*>;
35 } // namespace evolution
Defines type traits, some of which are future STL type_traits header.
Functionality for evolving hyperbolic partial differential equations.
Definition: ComputeTags.hpp:13