Commit 9ef7fa9b authored by Robert Maynard's avatar Robert Maynard
Browse files

Merge branch 'iterator_operator_square_bracket_corrected' into 'master'

Make sure we use ptrdiff_t for index into arrays.

This is a requirement since you can use negative indices into arrays.

See merge request !41
parents 7f7038d9 726c914e
......@@ -107,7 +107,7 @@ public:
VTKM_CONT_EXPORT
detail::IteratorFromArrayPortalValue<ArrayPortalType>
operator[](std::size_t idx) const
operator[](std::ptrdiff_t idx) const //NEEDS to be signed
{
return detail::IteratorFromArrayPortalValue<ArrayPortalType>(this->Portal,
this->Index + static_cast<vtkm::Id>(idx) );
......
......@@ -113,7 +113,7 @@ public:
VTKM_EXEC_EXPORT
PortalValue<ArrayPortalType>
operator[](std::size_t idx) const
operator[](std::ptrdiff_t idx) const //NEEDS to be signed
{
return PortalValue<ArrayPortalType>(this->Portal,
this->Index + static_cast<vtkm::Id>(idx) );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment