Skip to content

Commit

Permalink
Fixing assignement for iterator wrapper second, and adding unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
Type1J committed May 10, 2017
1 parent 6a656ed commit d6c78da
Show file tree
Hide file tree
Showing 3 changed files with 738 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/json.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -7913,6 +7913,14 @@ class basic_json
{
return proxy.value();
}

/// assignment operator (calls value())
template<typename ValueType>
iterator_value_property<ProxyType>& operator=(const ValueType& value)
{
proxy.value() = value;
return *this;
}
};

/// helper class for iteration
Expand Down
1 change: 1 addition & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ add_executable(${JSON_UNITTEST_TARGET_NAME}
"src/unit-element_access2.cpp"
"src/unit-inspection.cpp"
"src/unit-iterator_wrapper.cpp"
"src/unit-iterator_wrapper_first_second.cpp"
"src/unit-iterators1.cpp"
"src/unit-iterators2.cpp"
"src/unit-json_patch.cpp"
Expand Down
Loading

0 comments on commit d6c78da

Please sign in to comment.