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>>
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
-
ValueTypeCV | the provided value type |
ValueType | the returned value type |
- Returns
- copy of the JSON value, converted to
- Template Parameters
-
- Exceptions
-
what | json_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
20912
20913
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 }