Skip to content

Commit

Permalink
Added descriptions for begin(a) and end(a)
Browse files Browse the repository at this point in the history
Cleaned up examples a little
  • Loading branch information
nliber committed Jan 24, 2025
1 parent 790523a commit 333897b
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions docs/source/API/containers/Array.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,16 @@ Non-Member Functions
:return: ``std::move(a[I])`` (for tuple protocol / structured binding support)

.. cppkokkos:function:: template<class T, size_t N> constexpr T* begin(Array<T, N>& a) noexcept
.. cppkokkos:function:: template<class T, size_t N> constexpr const T* begin(const Array<T, N>& a) noexcept
:return: ``a.data()``

.. cppkokkos:function:: template<class T, size_t N> constexpr T* end(Array<T, N>& a) noexcept
.. cppkokkos:function:: template<class T, size_t N> constexpr const T* end(const Array<T, N>& a) noexcept
:return: ``a.data() + a.size()``


Deprecated since 4.4.00:
------------------------
Expand Down Expand Up @@ -194,9 +204,8 @@ ________
Kokkos::Array<int, 3> 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<int>(std::cout, " "));
std::reverse_copy(std::data(a2), end(a2), std::ostream_iterator<int>(std::cout, " "));
std::cout << '\n';
// Ranged for loop is supported
Expand Down

0 comments on commit 333897b

Please sign in to comment.