diff --git a/appveyor.yml b/appveyor.yml index 0623dce5b..21eddd70d 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -104,7 +104,7 @@ environment: before_build: - git submodule update --init --recursive -- cmake -H. -BBuild/VS -G "Visual Studio %VS_VERSION%" -DCMAKE_GENERATOR_PLATFORM=%VS_PLATFORM% -DCMAKE_VERBOSE_MAKEFILE=ON -DBUILD_SHARED_LIBS=true -DRAPIDJSON_BUILD_CXX11=%CXX11% -DRAPIDJSON_BUILD_CXX17=%CXX17% -DRAPIDJSON_BUILD_CXX20=%CXX20% -DRAPIDJSON_USE_MEMBERSMAP=%MEMBERSMAP% -Wno-dev +- cmake -H. -BBuild/VS -G "Visual Studio %VS_VERSION%" -DCMAKE_GENERATOR_PLATFORM=%VS_PLATFORM% -DCMAKE_VERBOSE_MAKEFILE=ON -DCMAKE_POLICY_VERSION_MINIMUM=3.5 -DBUILD_SHARED_LIBS=true -DRAPIDJSON_BUILD_CXX11=%CXX11% -DRAPIDJSON_BUILD_CXX17=%CXX17% -DRAPIDJSON_BUILD_CXX20=%CXX20% -DRAPIDJSON_USE_MEMBERSMAP=%MEMBERSMAP% -Wno-dev build: project: Build\VS\RapidJSON.sln diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h index 4b2d72322..cfeff8b0b 100644 --- a/include/rapidjson/document.h +++ b/include/rapidjson/document.h @@ -255,6 +255,9 @@ class GenericMemberIterator { Iterator& operator+=(DifferenceType n) { ptr_+=n; return *this; } Iterator& operator-=(DifferenceType n) { ptr_-=n; return *this; } + + friend Iterator operator+(DifferenceType n, const Iterator& i) { return Iterator(n+i.ptr_); } + friend Iterator operator-(DifferenceType n, const Iterator& i) { return Iterator(n-i.ptr_); } //@} //! @name relations