From a0ed981a7c235fb7535f2d6806697ef11fc765e9 Mon Sep 17 00:00:00 2001 From: elsid Date: Sat, 16 Feb 2019 15:09:57 +0300 Subject: [PATCH] Fix operator ++ for OutputTransformIterator --- components/detournavigator/findsmoothpath.hpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/components/detournavigator/findsmoothpath.hpp b/components/detournavigator/findsmoothpath.hpp index 81b732b744..c02e3315bd 100644 --- a/components/detournavigator/findsmoothpath.hpp +++ b/components/detournavigator/findsmoothpath.hpp @@ -81,21 +81,28 @@ namespace DetourNavigator return *this; } - OutputTransformIterator& operator ++(int) + OutputTransformIterator& operator ++() { - mImpl++; + ++mImpl.get(); return *this; } + OutputTransformIterator operator ++(int) + { + const auto copy = *this; + ++(*this); + return copy; + } + OutputTransformIterator& operator =(const osg::Vec3f& value) { - *mImpl = fromNavMeshCoordinates(mSettings, value); + *mImpl.get() = fromNavMeshCoordinates(mSettings, value); return *this; } private: - OutputIterator& mImpl; - const Settings& mSettings; + std::reference_wrapper mImpl; + std::reference_wrapper mSettings; }; inline void initNavMeshQuery(dtNavMeshQuery& value, const dtNavMesh& navMesh, const int maxNodes)