Skip to content

Commit

Permalink
Restrict TaggedVector operators (#795)
Browse files Browse the repository at this point in the history
  • Loading branch information
tpadioleau authored Mar 5, 2025
1 parent 35a2f54 commit 20fad08
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions include/ddc/detail/tagged_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,9 @@ class TaggedVector : public TaggedVectorConversionOperators<TaggedVector<Element
return *this;
}

template <class OElementType>
template <
class OElementType,
class = std::enable_if_t<std::is_convertible_v<OElementType, ElementType>>>
KOKKOS_FUNCTION constexpr TaggedVector& operator+=(OElementType const& rhs)
{
((m_values[type_seq_rank_v<Tags, tags_seq>] += rhs), ...);
Expand All @@ -388,7 +390,9 @@ class TaggedVector : public TaggedVectorConversionOperators<TaggedVector<Element
return *this;
}

template <class OElementType>
template <
class OElementType,
class = std::enable_if_t<std::is_convertible_v<OElementType, ElementType>>>
KOKKOS_FUNCTION constexpr TaggedVector& operator-=(OElementType const& rhs)
{
((m_values[type_seq_rank_v<Tags, tags_seq>] -= rhs), ...);
Expand Down

0 comments on commit 20fad08

Please sign in to comment.