MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / empty

Function empty

third-party/nlohmann/include/nlohmann/json.hpp:2641–2676  ·  view source on GitHub ↗

@brief checks whether the container is empty. @sa https://json.nlohmann.me/api/basic_json/empty/

Source from the content-addressed store, hash-verified

2639 /// @brief checks whether the container is empty.
2640 /// @sa https://json.nlohmann.me/api/basic_json/empty/
2641 bool empty() const noexcept
2642 {
2643 switch (m_type)
2644 {
2645 case value_t::null:
2646 {
2647 // null values are empty
2648 return true;
2649 }
2650
2651 case value_t::array:
2652 {
2653 // delegate call to array_t::empty()
2654 return m_value.array->empty();
2655 }
2656
2657 case value_t::object:
2658 {
2659 // delegate call to object_t::empty()
2660 return m_value.object->empty();
2661 }
2662
2663 case value_t::string:
2664 case value_t::boolean:
2665 case value_t::number_integer:
2666 case value_t::number_unsigned:
2667 case value_t::number_float:
2668 case value_t::binary:
2669 case value_t::discarded:
2670 default:
2671 {
2672 // all other types are nonempty
2673 return false;
2674 }
2675 }
2676 }
2677
2678 /// @brief returns the number of elements
2679 /// @sa https://json.nlohmann.me/api/basic_json/size/

Callers 4

parent_pointerMethod · 0.85
pop_backMethod · 0.85
json_pointerClass · 0.85
topFunction · 0.85

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected