Skip to content
Snippets Groups Projects
Commit 514e624c authored by Slattery, Stuart's avatar Slattery, Stuart
Browse files

Merge branch 'fixing_iterator_bounds' into 'master'

fixed off by one error in index end calculation

See merge request !6
parents 77b3c466 7c3c2958
Branches main
1 merge request!6fixed off by one error in index end calculation
......@@ -255,7 +255,10 @@ class AoSoA<MemberDataTypes<Types...>,Device,ArraySize>
CABANA_FUNCTION
Index end() const
{
return Index( array_size, _num_soa - 1, _size % array_size );
std::size_t remainder = _size % array_size;
std::size_t s = ( 0 == remainder ) ? _num_soa : _num_soa - 1;
std::size_t i = ( 0 == remainder ) ? 0 : remainder;
return Index( array_size, s, i );
}
// -------------------------------
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment