Skip to content

Commit f5017f3

Browse files
committed
Use | operator instead of +
1 parent f86bfe8 commit f5017f3

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

include/experimental/__p0009_bits/utility.hpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,14 @@ struct tuple_member {
108108
MDSPAN_FUNCTION constexpr const T& get() const { return val; }
109109
};
110110

111+
// A helper class which will be used via a fold expression to
112+
// select the type with the correct Idx in a pack of tuple_member
111113
template<size_t SearchIdx, size_t Idx, class T>
112114
struct tuple_idx_matcher {
113115
using type = tuple_member<T, Idx>;
114116
template<class Other>
115117
MDSPAN_FUNCTION
116-
constexpr auto operator + (Other v) const {
118+
constexpr auto operator | (Other v) const {
117119
if constexpr (Idx == SearchIdx) { return *this; }
118120
else { return v; }
119121
}
@@ -131,13 +133,13 @@ struct tuple_impl<std::index_sequence<Idx...>, Elements...>: public tuple_member
131133
template<size_t N>
132134
MDSPAN_FUNCTION
133135
constexpr auto& get() {
134-
using base_t = decltype((tuple_idx_matcher<N, Idx, Elements>() + ...) );
136+
using base_t = decltype((tuple_idx_matcher<N, Idx, Elements>() | ...) );
135137
return base_t::type::get();
136138
}
137139
template<size_t N>
138140
MDSPAN_FUNCTION
139141
constexpr const auto& get() const {
140-
using base_t = decltype((tuple_idx_matcher<N, Idx, Elements>() + ...) );
142+
using base_t = decltype((tuple_idx_matcher<N, Idx, Elements>() | ...) );
141143
return base_t::type::get();
142144
}
143145
};

0 commit comments

Comments
 (0)