diff --git a/vtkm/cont/MultiBlock.h b/vtkm/cont/MultiBlock.h index 6b732c336..394ea4cae 100644 --- a/vtkm/cont/MultiBlock.h +++ b/vtkm/cont/MultiBlock.h @@ -111,6 +111,15 @@ public: VTKM_CONT void PrintSummary(std::ostream& stream) const; + //@{ + /// API to support range-based for loops on blocks. + std::vector::iterator begin() noexcept { return this->Blocks.begin(); } + std::vector::iterator end() noexcept { return this->Blocks.end(); } + std::vector::const_iterator begin() const noexcept { return this->Blocks.begin(); } + std::vector::const_iterator end() const noexcept { return this->Blocks.end(); } + std::vector::const_iterator cbegin() const noexcept { return this->Blocks.begin(); } + std::vector::const_iterator cend() const noexcept { return this->Blocks.end(); } + //@} private: std::vector Blocks; };