MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / empty

Function empty

dependencies/json/json.hpp:21504–21532  ·  view source on GitHub ↗

! @brief checks whether the container is empty. Checks if a JSON value has no elements (i.e. whether its @ref size is `0`). @return The return value depends on the different types and is defined as follows: Value type | return value ----------- | ------------- null | `true` boolean | `false` string

Source from the content-addressed store, hash-verified

21502 @since version 1.0.0
21503 */
21504 bool empty() const noexcept
21505 {
21506 switch (m_type)
21507 {
21508 case value_t::null:
21509 {
21510 // null values are empty
21511 return true;
21512 }
21513
21514 case value_t::array:
21515 {
21516 // delegate call to array_t::empty()
21517 return m_value.array->empty();
21518 }
21519
21520 case value_t::object:
21521 {
21522 // delegate call to object_t::empty()
21523 return m_value.object->empty();
21524 }
21525
21526 default:
21527 {
21528 // all other types are nonempty
21529 return false;
21530 }
21531 }
21532 }
21533
21534 /*!
21535 @brief returns the number of elements

Callers 4

parent_pointerMethod · 0.70
pop_backMethod · 0.70
json_pointerClass · 0.70
topFunction · 0.70

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected