16 #ifndef dealii_template_constraints_h 17 #define dealii_template_constraints_h 20 #include <deal.II/base/config.h> 22 #include <deal.II/base/complex_overloads.h> 28 DEAL_II_NAMESPACE_OPEN
32 namespace TemplateConstraints
35 template <
bool... Values>
43 template <
bool... Values>
46 static constexpr
bool value =
47 std::is_same<BoolStorage<Values...,
true>,
48 BoolStorage<
true, Values...>>::value;
59 template <
class Base,
class... Derived>
63 std::is_base_of<Base, Derived>::value...>::value;
74 template <
class Type,
class... Types>
78 std::is_same<Type, Types>::value...>::value;
88 template <
bool... Values>
90 : std::enable_if<internal::TemplateConstraints::all_true<Values...>::value>
100 template <
typename T>
103 template <
typename C>
104 static std::false_type
107 template <
typename C>
109 test(
int) -> decltype(std::begin(std::declval<C>()),
110 std::end(std::declval<C>()),
114 using type = decltype(test<T>(0));
116 static const bool value = type::value;
121 template <
bool,
typename>
122 struct constraint_and_return_value;
200 template <
typename T>
201 struct DEAL_II_DEPRECATED constraint_and_return_value<true, T>
267 template <
typename T>
299 template <
typename T>
313 template <
typename T,
typename U>
440 template <
typename T,
typename U>
460 template <
typename T,
typename U>
463 using type = decltype(std::declval<T>() * std::declval<U>());
518 template <
typename T,
typename U>
523 typename std::decay<U>::type>::type;
533 template <
typename T>
534 struct ProductTypeImpl<
std::complex<T>, std::complex<T>>
536 using type = std::complex<T>;
539 template <
typename T,
typename U>
540 struct ProductTypeImpl<
std::complex<T>, std::complex<U>>
542 using type = std::complex<typename ProductType<T, U>::type>;
545 template <
typename U>
546 struct ProductTypeImpl<double,
std::complex<U>>
548 using type = std::complex<typename ProductType<double, U>::type>;
551 template <
typename T>
552 struct ProductTypeImpl<
std::complex<T>, double>
554 using type = std::complex<typename ProductType<T, double>::type>;
557 template <
typename U>
558 struct ProductTypeImpl<float,
std::complex<U>>
560 using type = std::complex<typename ProductType<float, U>::type>;
563 template <
typename T>
564 struct ProductTypeImpl<
std::complex<T>, float>
566 using type = std::complex<typename ProductType<T, float>::type>;
630 template <
typename T>
649 using type =
long double;
661 using type =
unsigned int;
664 template <
typename T>
667 using type = std::complex<T>;
671 DEAL_II_NAMESPACE_CLOSE
static bool equal(const T *, const U *)
static bool equal(const T *p1, const T *p2)