Skip to content
Snippets Groups Projects
Commit 1e823da3 authored by Stéphane Del Pino's avatar Stéphane Del Pino
Browse files

Add bound check

parent c48bc773
No related branches found
No related tags found
1 merge request!7Feature/itemvalue
#ifndef ARRAY_HPP
#define ARRAY_HPP
#include <PastisAssert.hpp>
#include <Kokkos_Core.hpp>
template <typename DataType>
......@@ -22,6 +23,7 @@ class Array
KOKKOS_INLINE_FUNCTION
DataType& operator[](const size_t& i) const
{
Assert(i<m_values.extent(0));
return m_values[i];
}
......@@ -64,6 +66,9 @@ class Array
this->operator=(array);
}
KOKKOS_INLINE_FUNCTION
Array(Array&&) = default;
KOKKOS_INLINE_FUNCTION
Array(const Array&) = default;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment