TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ calc_bson_array_size()

template<typename BasicJsonType , typename CharType >
static std::size_t nlohmann::detail::binary_writer< BasicJsonType, CharType >::calc_bson_array_size ( const typename BasicJsonType::array_t &  value)
inlinestaticprivate
Returns
The size of the BSON-encoded array value

Definition at line 14937 of file json.hpp.

14938 {
14939 std::size_t array_index = 0ul;
14940 const std::size_t embedded_document_size = std::accumulate(std::begin(value), std::end(value), std::size_t(0), [&array_index](std::size_t result, const typename BasicJsonType::array_t::value_type & el)
14941 {
14942 return result + calc_bson_element_size(std::to_string(array_index++), el);
14943 });
14944 return sizeof(std::int32_t) + embedded_document_size + 1ul;
14945 }
static std::size_t calc_bson_element_size(const string_t &name, const BasicJsonType &j)
Calculates the size necessary to serialize the JSON value j with its name.
Definition: json.hpp:14989