From 430a1c9102bcf4924b59ab4c283fc64d3e2dc095 Mon Sep 17 00:00:00 2001 From: Sylvain Corlay Date: Sun, 18 Dec 2016 12:07:31 +0100 Subject: [PATCH] Make stepper_begin and stepper_end templates --- include/xtensor-python/pyarray.hpp | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/include/xtensor-python/pyarray.hpp b/include/xtensor-python/pyarray.hpp index 9d52341..4ae8b5c 100644 --- a/include/xtensor-python/pyarray.hpp +++ b/include/xtensor-python/pyarray.hpp @@ -165,11 +165,15 @@ namespace xt template xiterator cxend(const S& shape) const; - stepper stepper_begin(const shape_type& shape); - stepper stepper_end(const shape_type& shape); + template + stepper stepper_begin(const S& shape); + template + stepper stepper_end(const S& shape); - const_stepper stepper_begin(const shape_type& shape) const; - const_stepper stepper_end(const shape_type& shape) const; + template + const_stepper stepper_begin(const S& shape) const; + template + const_stepper stepper_end(const S& shape) const; storage_iterator storage_begin(); storage_iterator storage_end(); @@ -474,28 +478,32 @@ namespace xt } template - inline auto pyarray::stepper_begin(const shape_type& shape) -> stepper + template + inline auto pyarray::stepper_begin(const S& shape) -> stepper { size_type offset = shape.size() - dimension(); return stepper(this, storage_begin(), offset); } template - inline auto pyarray::stepper_end(const shape_type& shape) -> stepper + template + inline auto pyarray::stepper_end(const S& shape) -> stepper { size_type offset = shape.size() - dimension(); return stepper(this, storage_end(), offset); } template - inline auto pyarray::stepper_begin(const shape_type& shape) const -> const_stepper + template + inline auto pyarray::stepper_begin(const S& shape) const -> const_stepper { size_type offset = shape.size() - dimension(); return const_stepper(this, storage_begin(), offset); } template - inline auto pyarray::stepper_end(const shape_type& shape) const -> const_stepper + template + inline auto pyarray::stepper_end(const S& shape) const -> const_stepper { size_type offset = shape.size() - dimension(); return const_stepper(this, storage_end(), offset);