Skip to content

Commit

Permalink
Add the MathObjectConcept class
Browse files Browse the repository at this point in the history
  • Loading branch information
thelfer committed Jul 3, 2024
1 parent e6f6eaa commit 8676b03
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions include/TFEL/Math/General/MathObjectTraits.hxx
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ namespace tfel::math {
*/
template <typename ValueType, typename SizeType>
struct MathObjectTraitsBase {
//! \brief flag stating if the MathObjectTraitsBase class has been specialized
static constexpr auto is_specialized =
!((tfel::typetraits::isInvalid<ValueType>())||
(tfel::typetraits::isInvalid<SizeType>()));
/*!
* \brief numerical type on which the object is based
*/
Expand Down Expand Up @@ -140,6 +144,9 @@ namespace tfel::math {
template <typename T>
concept ScalarConcept = tfel::typetraits::IsScalar<std::decay_t<T>>::cond;

template <typename T>
concept MathObjectConcept = MathObjectTraits<T>::is_specialized;

} // end of namespace tfel::math

#endif /* LIB_TFEL_MATH_GENERAL_MATHOBJECTTRAITS_HXX */

0 comments on commit 8676b03

Please sign in to comment.