Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion cpp/dolfinx/common/types.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,16 @@ namespace dolfinx
/// @private This concept is used to constrain the a template type to floating
/// point real or complex types. Note that this concept is different to
/// std::floating_point which does not include std::complex.

template <class T>
struct is_custom_scalar : std::false_type
{
};

template <class T>
concept scalar = std::floating_point<T>
|| std::is_same_v<T, std::complex<typename T::value_type>>;
|| std::is_same_v<T, std::complex<typename T::value_type>>
|| is_custom_scalar<T>::value;

/// @private These structs are used to get the float/value type from a
/// template argument, including support for complex types.
Expand Down
Loading
Loading