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 PointerType , detail::enable_if_t< std::is_pointer< PointerType >
::value, int > = 0>
constexpr auto nlohmann::basic_json< ObjectType, ArrayType, StringType, BooleanType, NumberIntegerType, NumberUnsignedType, NumberFloatType, AllocatorType, JSONSerializer, BinaryType >::get_impl |
( |
detail::priority_tag< 4 > |
| ) |
const -> decltype(std::declval<const basic_json_t &>().template get_ptr<PointerType>())
|
|
inlineconstexprprivatenoexcept |
get a pointer value (explicit)
get a pointer value (explicit)
Explicit pointer access to the internally stored JSON value. No copies are made.
- Warning
- The pointer becomes invalid if the underlying JSON object changes.
- Template Parameters
-
- Returns
- pointer to the internally stored JSON value if the requested pointer type PointerType fits to the JSON value;
nullptr
otherwise
@complexity Constant.
@liveexample{The example below shows how pointers to internal values of a JSON value can be requested. Note that no type conversions are made and a nullptr
is returned if the value and the requested pointer type does not match.,get__PointerType}
- See also
- see get_ptr() for explicit pointer-member access
- Since
- version 1.0.0
Definition at line 20872 of file json.hpp.
20874 {
20875
20876 return get_ptr<PointerType>();
20877 }