@brief returns the maximum possible number of elements @sa https://json.nlohmann.me/api/basic_json/max_size/
| 3011 | /// @brief returns the maximum possible number of elements |
| 3012 | /// @sa https://json.nlohmann.me/api/basic_json/max_size/ |
| 3013 | size_type max_size() const noexcept |
| 3014 | { |
| 3015 | switch (m_data.m_type) |
| 3016 | { |
| 3017 | case value_t::array: |
| 3018 | { |
| 3019 | // delegate call to array_t::max_size() |
| 3020 | return m_data.m_value.array->max_size(); |
| 3021 | } |
| 3022 | |
| 3023 | case value_t::object: |
| 3024 | { |
| 3025 | // delegate call to object_t::max_size() |
| 3026 | return m_data.m_value.object->max_size(); |
| 3027 | } |
| 3028 | |
| 3029 | case value_t::null: |
| 3030 | case value_t::string: |
| 3031 | case value_t::boolean: |
| 3032 | case value_t::number_integer: |
| 3033 | case value_t::number_unsigned: |
| 3034 | case value_t::number_float: |
| 3035 | case value_t::binary: |
| 3036 | case value_t::discarded: |
| 3037 | default: |
| 3038 | { |
| 3039 | // all other types have max_size() == size() |
| 3040 | return size(); |
| 3041 | } |
| 3042 | } |
| 3043 | } |
| 3044 | |
| 3045 | /// @} |
| 3046 |