JSON for Modern C++  3.0
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 = int64_t, class NumberFloatType = double, template< typename U > class AllocatorType = std::allocator>
long double nlohmann::basic_json::lexer::get_number ( ) const
inline

This function translates the last token into a floating point number. The pointer m_begin points to the beginning of the parsed number. We pass this pointer to std::strtod which sets endptr to the first character past the converted number. If this pointer is not the same as m_cursor, then either more or less characters have been used during the comparison. This can happen for inputs like "01" which will be treated like number 0 followed by number 1.

Returns
the result of the number conversion or NAN if the conversion read past the current token. The latter case needs to be treated by the caller function.
Exceptions
std::range_errorif passed value is out of range