MCPcopy Create free account
hub / github.com/PeterFWS/Structure-PLP-SLAM / empty

Function empty

3rd/json/include/nlohmann/json.hpp:17244–17272  ·  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

17242 @since version 1.0.0
17243 */
17244 bool empty() const noexcept
17245 {
17246 switch (m_type)
17247 {
17248 case value_t::null:
17249 {
17250 // null values are empty
17251 return true;
17252 }
17253
17254 case value_t::array:
17255 {
17256 // delegate call to array_t::empty()
17257 return m_value.array->empty();
17258 }
17259
17260 case value_t::object:
17261 {
17262 // delegate call to object_t::empty()
17263 return m_value.object->empty();
17264 }
17265
17266 default:
17267 {
17268 // all other types are nonempty
17269 return false;
17270 }
17271 }
17272 }
17273
17274 /*!
17275 @brief returns the number of elements

Callers 4

parent_pointerMethod · 0.85
pop_backMethod · 0.85
json_pointerClass · 0.85
topMethod · 0.85

Calls 1

emptyMethod · 0.45

Tested by

no test coverage detected