Skip to content

Commit

Permalink
Ensure that complex is only instantiated for cv-unqualified floating-…
Browse files Browse the repository at this point in the history
…point type
  • Loading branch information
dalg24 committed Jul 1, 2023
1 parent 91b57f1 commit 113055e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions core/src/Kokkos_Complex.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ class
alignas(2 * sizeof(RealType))
#endif
complex {
static_assert(std::is_floating_point_v<RealType> &&
std::is_same_v<RealType, std::remove_cv_t<RealType>>,
"Kokkos::complex can only be instantiated for a cv-unqualified "
"floating point type");

private:
RealType re_{};
RealType im_{};
Expand Down

0 comments on commit 113055e

Please sign in to comment.