From 333897b1b12c26f87bfd9464e344e5aaad26a291 Mon Sep 17 00:00:00 2001 From: "Nevin \":-)\" Liber" Date: Thu, 23 Jan 2025 21:29:32 -0600 Subject: [PATCH] Added descriptions for begin(a) and end(a) Cleaned up examples a little --- docs/source/API/containers/Array.rst | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/source/API/containers/Array.rst b/docs/source/API/containers/Array.rst index a96596345..8df27128c 100644 --- a/docs/source/API/containers/Array.rst +++ b/docs/source/API/containers/Array.rst @@ -134,6 +134,16 @@ Non-Member Functions :return: ``std::move(a[I])`` (for tuple protocol / structured binding support) +.. cppkokkos:function:: template constexpr T* begin(Array& a) noexcept +.. cppkokkos:function:: template constexpr const T* begin(const Array& a) noexcept + + :return: ``a.data()`` + +.. cppkokkos:function:: template constexpr T* end(Array& a) noexcept +.. cppkokkos:function:: template constexpr const T* end(const Array& a) noexcept + + :return: ``a.data() + a.size()`` + Deprecated since 4.4.00: ------------------------ @@ -194,9 +204,8 @@ ________ Kokkos::Array a2 = {1, 2, 3}; // Double braces never required after = - // data() is supported // Output is 3 2 1 - std::reverse_copy(a2.data(), a2.data() + a2.size(), std::ostream_iterator(std::cout, " ")); + std::reverse_copy(std::data(a2), end(a2), std::ostream_iterator(std::cout, " ")); std::cout << '\n'; // Ranged for loop is supported