mirror of
https://github.com/nlohmann/json.git
synced 2025-07-27 00:41:05 +03:00
* 🔥 consolidate documentation * ♻️ overwork std specializations * 🚚 move images files to mkdocs * ♻️ fix URLs * 🔧 tweak MkDocs configuration * 🔧 add namespaces * 📝 document deprecations * 📝 document documentation generation * 🚸 improve search * 🚸 add examples * 🚧 start adding documentation for macros * 📝 add note for https://github.com/nlohmann/json/issues/874#issuecomment-1001699139 * 📝 overwork example handling * 📝 fix Markdown tables
1.1 KiB
1.1 KiB
nlohmann::basic_json::operator>
bool operator>(const_reference lhs, const_reference rhs) noexcept,
template<typename ScalarType>
bool operator>(const_reference lhs, const ScalarType rhs) noexcept;
template<typename ScalarType>
bool operator>(ScalarType lhs, const const_reference rhs) noexcept;
Compares whether one JSON value lhs
is greater than another JSON value rhs
by calculating #!cpp !(lhs <= rhs)
.
Template parameters
ScalarType
- a scalar type according to
std::is_scalar<ScalarType>::value
Parameters
lhs
(in)- first value to consider
rhs
(in)- second value to consider
Return value
whether lhs
is greater than rhs
Exception safety
No-throw guarantee: this function never throws exceptions.
Complexity
Linear.
Examples
??? example
The example demonstrates comparing several JSON types.
```cpp
--8<-- "examples/operator__greater.cpp"
```
Output:
```json
--8<-- "examples/operator__greater.output"
```
Version history
- Added in version 1.0.0.