diff --git a/src/include/ranges/srange.cc.h b/src/include/ranges/srange.cc.h index 7c9dfde..8a6a33f 100644 --- a/src/include/ranges/srange.cc.h +++ b/src/include/ranges/srange.cc.h @@ -128,9 +128,14 @@ namespace CNORXZ template template - UPos SIndex::stepSize(const IndexId& id) const + decltype(auto) SIndex::stepSize(const IndexId& id) const { - return UPos(id == this->id() ? 1 : 0); + if constexpr(I != 0){ + return SPos<0>(); + } + else { + return UPos(id == this->id() ? 1 : 0); + } } template diff --git a/src/include/ranges/srange.h b/src/include/ranges/srange.h index 5cf1661..dc7598f 100644 --- a/src/include/ranges/srange.h +++ b/src/include/ranges/srange.h @@ -88,7 +88,7 @@ namespace CNORXZ /** @copydoc IndexInterface::stepSize() */ template - UPos stepSize(const IndexId& id) const; + decltype(auto) stepSize(const IndexId& id) const; /** @copydoc IndexInterface::stringMeta() */ String stringMeta() const;