Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs have incorrect info for update() #4307

Closed
whompyjaw opened this issue Mar 12, 2024 · 0 comments · Fixed by #4310
Closed

Docs have incorrect info for update() #4307

whompyjaw opened this issue Mar 12, 2024 · 0 comments · Fixed by #4310
Labels
documentation kind: bug solution: proposed fix a fix for the issue has been proposed and waits for confirmation

Comments

@whompyjaw
Copy link

Description

Docs say that v3.10.4 has merge_update as a parameter, but it actually does not. v3.10.5 does.

void update(const_reference j, bool merge_objects = false)

My team uses 3.10.4 and ran into this.

Reproduction steps

No production needed. Comparing the code is sufficient.

Expected vs. actual results

I expected merge_objects to be in 3.10.4 per the docs stating that.

Minimal code example

No response

Error messages

eanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType>::update(const_reference) [with ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::adl_serializer; BinaryType = std::vector<unsigned char>; const_reference = const nlohmann::basic_json<>&]’
23501 |     void update(const_reference j)
      |          ^~~~~~
json_nlohmann-3.10.4/single_include/nlohmann/json.hpp:23501:10: note:   candidate expects 1 argument, 2 provided
json_nlohmann-3.10.4/single_include/nlohmann/json.hpp:23555:10: note: candidate: ‘void nlohmann::basic_json<ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType>::update(const_iterator, const_iterator) [with ObjectType = std::map; ArrayType = std::vector; StringType = std::__cxx11::basic_string<char>; BooleanType = bool; NumberIntegerType = long int; NumberUnsignedType = long unsigned int; NumberFloatType = double; AllocatorType = std::allocator; JSONSerializer = nlohmann::adl_serializer; BinaryType = std::vector<unsigned char>; const_iterator = nlohmann::detail::iter_impl<const nlohmann::basic_json<> >]’
23555 |     void update(const_iterator first, const_iterator last)
      |          ^~~~~~
json_nlohmann-3.10.4/single_include/nlohmann/json.hpp:23555:32: note:   no known conversion for argument 1 from ‘json’ {aka ‘nlohmann::basic_json<>’} to ‘nlohmann::basic_json<>::const_iterator’ {aka ‘nlohmann::detail::iter_impl<const nlohmann::basic_json<> >’}
23555 |     void update(const_iterator first, const_iterator last)


### Compiler and operating system

Linux SLES 15

### Library version

3.10.4

### Validation

- [ ] The bug also occurs if the latest version from the [`develop`](https://github.com/nlohmann/json/tree/develop) branch is used.
- [ ] I can successfully [compile and run the unit tests](https://github.com/nlohmann/json#execute-unit-tests).
@whompyjaw whompyjaw changed the title 3.10.4 docs have incorrect info 3.10.4 docs have incorrect info for update() Mar 12, 2024
@whompyjaw whompyjaw changed the title 3.10.4 docs have incorrect info for update() Docs have incorrect info for update() Mar 12, 2024
@nlohmann nlohmann linked a pull request Mar 15, 2024 that will close this issue
@nlohmann nlohmann added this to the Release 3.11.4 milestone Mar 15, 2024
@nlohmann nlohmann added documentation solution: proposed fix a fix for the issue has been proposed and waits for confirmation labels Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation kind: bug solution: proposed fix a fix for the issue has been proposed and waits for confirmation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants