TerraForge3D  2.3.1
3D Terrain And Landscape Generator

◆ get() [1/2]

template<template< typename U, typename V, typename... Args > class ObjectType = std::map, template< typename U, typename... Args > class ArrayType = std::vector, class StringType = std::string, class BooleanType = bool, class NumberIntegerType = std::int64_t, class NumberUnsignedType = std::uint64_t, class NumberFloatType = double, template< typename U > class AllocatorType = std::allocator, template< typename T, typename SFINAE=void > class JSONSerializer = adl_serializer, class BinaryType = std::vector<std::uint8_t>>
template<typename ValueTypeCV , typename ValueType = detail::uncvref_t<ValueTypeCV>>
auto nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::get ( ) const -> decltype(std::declval<const basic_json_t &>().template get_impl<ValueType>(detail::priority_tag<4> {}))
inlinenoexcept

get a (pointer) value (explicit)

Performs explicit type conversion between the JSON value and a compatible value if required.

  • If the requested type is a pointer to the internally stored JSON value that pointer is returned. No copies are made.
  • If the requested type is the current basic_json, or a different basic_json convertible from the current basic_json.
  • Otherwise the value is converted by calling the json_serializer<ValueType> from_json() method.
Template Parameters
ValueTypeCVthe provided value type
ValueTypethe returned value type
Returns
copy of the JSON value, converted to
Template Parameters
ValueTypeif necessary
Exceptions
whatjson_serializer<ValueType> from_json() method throws if conversion is required
Since
version 2.1.0

Definition at line 20907 of file json.hpp.

20908 {})))
20909 -> decltype(std::declval<const basic_json_t &>().template get_impl<ValueType>(detail::priority_tag<4> {}))
20910 {
20911 // we cannot static_assert on ValueTypeCV being non-const, because
20912 // there is support for get<const basic_json_t>(), which is why we
20913 // still need the uncvref
20914 static_assert(!std::is_reference<ValueTypeCV>::value,
20915 "get() cannot be used with reference types, you might want to use get_ref()");
20916 return get_impl<ValueType>(detail::priority_tag<4> {});
20917 }