Drop the class wrapper from the C++20 comparison operator signatures in the docs

The signature boxes of operator<=> and the C++20 half of operator== wrapped
the member declarations in an incomplete "class basic_json { ... };". The
trailing const already marks them as members, and no other page uses such a
wrapper.

Signed-off-by: Niels Lohmann <mail@nlohmann.me>
This commit is contained in:
Niels Lohmann committed 2026-10-13 18:33:06 +02:00
1 parent e839bbd1c0
commit 6bb7e63452
2 files changed
+6 -10

No files matched your search

@@ -11,12 +11,10 @@ template<typename ScalarType>
bool operator==(ScalarType lhs, const const_reference rhs) noexcept(/* see below */); // (2)
// since C++20
class basic_json {
bool operator==(const_reference rhs) const noexcept; // (1)
bool operator==(const_reference rhs) const noexcept; // (1)
template<typename ScalarType>
bool operator==(ScalarType rhs) const noexcept(/* see below */); // (2)
};
template<typename ScalarType>
bool operator==(ScalarType rhs) const noexcept(/* see below */); // (2)
```
1. Compares two JSON values for equality according to the following rules:
@@ -2,12 +2,10 @@
```cpp
// since C++20
class basic_json {
std::partial_ordering operator<=>(const_reference rhs) const noexcept; // (1)
std::partial_ordering operator<=>(const_reference rhs) const noexcept; // (1)
template<typename ScalarType>
std::partial_ordering operator<=>(const ScalarType rhs) const noexcept(/* see below */); // (2)
};
template<typename ScalarType>
std::partial_ordering operator<=>(const ScalarType rhs) const noexcept(/* see below */); // (2)
```
1. 3-way compares two JSON values producing a result of type `std::partial_ordering` according to the following rules: