MCPcopy Create free account
hub / github.com/CppCXY/EmmyLuaCodeStyle / max_size

Function max_size

3rd/nlohmann_json/include/nlohmann/json.hpp:5293–5323  ·  view source on GitHub ↗

! @brief returns the maximum possible number of elements Returns the maximum number of elements a JSON value is able to hold due to system or library implementation limitations, i.e. `std::distance(begin(), end())` for the JSON value. @return The return value depends on the different types and is defined as follows: Value type | return value

Source from the content-addressed store, hash-verified

5291 @since version 1.0.0
5292 */
5293 size_type max_size() const noexcept
5294 {
5295 switch (m_type)
5296 {
5297 case value_t::array:
5298 {
5299 // delegate call to array_t::max_size()
5300 return m_value.array->max_size();
5301 }
5302
5303 case value_t::object:
5304 {
5305 // delegate call to object_t::max_size()
5306 return m_value.object->max_size();
5307 }
5308
5309 case value_t::null:
5310 case value_t::string:
5311 case value_t::boolean:
5312 case value_t::number_integer:
5313 case value_t::number_unsigned:
5314 case value_t::number_float:
5315 case value_t::binary:
5316 case value_t::discarded:
5317 default:
5318 {
5319 // all other types have max_size() == size()
5320 return size();
5321 }
5322 }
5323 }
5324
5325 /// @}
5326

Callers

nothing calls this directly

Calls 2

sizeFunction · 0.70
max_sizeMethod · 0.45

Tested by

no test coverage detected