-
-
Notifications
You must be signed in to change notification settings - Fork 7.1k
Closed
Labels
kind: bugrelease item: 🐛 bug fixsolution: proposed fixa fix for the issue has been proposed and waits for confirmationa fix for the issue has been proposed and waits for confirmation
Milestone
Description
Description
Example https://github.com/nlohmann/json/blob/develop/docs/examples/json_pointer__pop_back.cpp does not compile.
It used to compile. Not sure when this broke.
Reproduction steps
Call
make -C docs
Expected vs. actual results
Expected: code compiles
Actual:
GCC:
examples/json_pointer__back.cpp: In function 'int main()':
examples/json_pointer__back.cpp:13:45: error: no match for 'operator<<' (operand types are 'std::basic_ostream<char>' and 'nlohmann::basic_json<>::json_pointer' {aka 'nlohmann::json_pointer<std::__cxx11::basic_string<char> >'})
13 | std::cout << "last reference token of " << ptr1 << " is " << ptr1.back() << '\n'
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~ ~~~~
| | |
| std::basic_ostream<char> nlohmann::basic_json<>::json_pointer {aka nlohmann::json_pointer<std::__cxx11::basic_string<char> >}
Clang:
examples/json_pointer__back.cpp:13:45: error: invalid operands to binary expression ('basic_ostream<char, std::char_traits<char>>' and 'json::json_pointer' (aka 'json_pointer<std::string>'))
std::cout << "last reference token of " << ptr1 << " is " << ptr1.back() << '\n'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^ ~~~~
Minimal code example
No response
Error messages
No response
Compiler and operating system
Apple clang version 13.1.6 (clang-1316.0.21.2.5) and g++-11 (Homebrew GCC 11.3.0_2) 11.3.0
Library version
develop
Validation
- The bug also occurs if the latest version from the
develop
branch is used. - I can successfully compile and run the unit tests.
Metadata
Metadata
Assignees
Labels
kind: bugrelease item: 🐛 bug fixsolution: proposed fixa fix for the issue has been proposed and waits for confirmationa fix for the issue has been proposed and waits for confirmation