Skip to content

Commit d6c78da

Browse files
committed
Fixing assignement for iterator wrapper second, and adding unit test
1 parent 6a656ed commit d6c78da

3 files changed

Lines changed: 738 additions & 0 deletions

File tree

src/json.hpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7913,6 +7913,14 @@ class basic_json
79137913
{
79147914
return proxy.value();
79157915
}
7916+
7917+
/// assignment operator (calls value())
7918+
template<typename ValueType>
7919+
iterator_value_property<ProxyType>& operator=(const ValueType& value)
7920+
{
7921+
proxy.value() = value;
7922+
return *this;
7923+
}
79167924
};
79177925

79187926
/// helper class for iteration

test/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ add_executable(${JSON_UNITTEST_TARGET_NAME}
3030
"src/unit-element_access2.cpp"
3131
"src/unit-inspection.cpp"
3232
"src/unit-iterator_wrapper.cpp"
33+
"src/unit-iterator_wrapper_first_second.cpp"
3334
"src/unit-iterators1.cpp"
3435
"src/unit-iterators2.cpp"
3536
"src/unit-json_patch.cpp"

0 commit comments

Comments
 (0)