Skip to content

Docs have incorrect info for update() #4307

Closed

Description

@goberlan

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).

Activity

  1. changed the title [-]3.10.4 docs have incorrect info[/-] [+]3.10.4 docs have incorrect info for `update()`[/+] on Mar 12, 2024
  2. changed the title [-]3.10.4 docs have incorrect info for `update()`[/-] [+]Docs have incorrect info for `update()`[/+] on Mar 12, 2024
  3. linked a pull request that will close this issue#4307 Updated docx to 3.10.5 from 3.10.4 #4310on Mar 15, 2024
  4. added this to the Release 3.11.4 milestone on Mar 15, 2024
  5. added a commit that references this issue on Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      ⌂ 换网址