66
77#include < cassert>
88#include < string>
9- #include < type_traits>
109#include < utility>
1110
1211#include < Kokkos_Core.hpp>
1312
1413#include " detail/kokkos.hpp"
15- #include " detail/type_traits.hpp"
1614
1715#include " chunk_common.hpp"
1816#include " chunk_span.hpp"
@@ -166,21 +164,17 @@ class Chunk : public ChunkCommon<ElementType, SupportType, Kokkos::layout_right>
166164 }
167165
168166 // / Slice out some dimensions
169- template <
170- class ... QueryDDims,
171- class SFINAESupportType = SupportType,
172- std::enable_if_t <is_discrete_domain_v<SFINAESupportType>, int > = 0 >
167+ template <class ... QueryDDims>
173168 auto operator [](DiscreteDomain<QueryDDims...> const & odomain) const
169+ requires (is_discrete_domain_v<SupportType>)
174170 {
175171 return span_view ()[odomain];
176172 }
177173
178174 // / Slice out some dimensions
179- template <
180- class ... QueryDDims,
181- class SFINAESupportType = SupportType,
182- std::enable_if_t <is_discrete_domain_v<SFINAESupportType>, int > = 0 >
175+ template <class ... QueryDDims>
183176 auto operator [](DiscreteDomain<QueryDDims...> const & odomain)
177+ requires (is_discrete_domain_v<SupportType>)
184178 {
185179 return span_view ()[odomain];
186180 }
@@ -189,9 +183,7 @@ class Chunk : public ChunkCommon<ElementType, SupportType, Kokkos::layout_right>
189183 * @param delems discrete coordinates
190184 * @return const-reference to this element
191185 */
192- template <
193- class ... DElems,
194- std::enable_if_t <detail::all_of_v<is_discrete_element_v<DElems>...>, int > = 0 >
186+ template <concepts::discrete_element... DElems>
195187 element_type const & operator ()(DElems const &... delems) const noexcept
196188 {
197189 static_assert (
@@ -207,11 +199,9 @@ class Chunk : public ChunkCommon<ElementType, SupportType, Kokkos::layout_right>
207199 * @param dvects discrete vectors
208200 * @return reference to this element
209201 */
210- template <
211- class ... DVects,
212- std::enable_if_t <detail::all_of_v<is_discrete_vector_v<DVects>...>, int > = 0 ,
213- std::enable_if_t <sizeof ...(DVects) != 0 , int > = 0 >
202+ template <concepts::discrete_vector... DVects>
214203 element_type const & operator ()(DVects const &... dvects) const noexcept
204+ requires(sizeof ...(DVects) != 0)
215205 {
216206 static_assert (
217207 SupportType::rank () == (0 + ... + DVects::size ()),
@@ -225,9 +215,7 @@ class Chunk : public ChunkCommon<ElementType, SupportType, Kokkos::layout_right>
225215 * @param delems discrete coordinates
226216 * @return reference to this element
227217 */
228- template <
229- class ... DElems,
230- std::enable_if_t <detail::all_of_v<is_discrete_element_v<DElems>...>, int > = 0 >
218+ template <concepts::discrete_element... DElems>
231219 element_type& operator ()(DElems const &... delems) noexcept
232220 {
233221 static_assert (
@@ -243,11 +231,9 @@ class Chunk : public ChunkCommon<ElementType, SupportType, Kokkos::layout_right>
243231 * @param dvects discrete vectors
244232 * @return reference to this element
245233 */
246- template <
247- class ... DVects,
248- std::enable_if_t <detail::all_of_v<is_discrete_vector_v<DVects>...>, int > = 0 ,
249- std::enable_if_t <sizeof ...(DVects) != 0 , int > = 0 >
234+ template <concepts::discrete_vector... DVects>
250235 element_type& operator ()(DVects const &... dvects) noexcept
236+ requires(sizeof ...(DVects) != 0)
251237 {
252238 static_assert (
253239 SupportType::rank () == (0 + ... + DVects::size ()),
0 commit comments