std::num_get<CharT,InputIt>::get,std::num_get<CharT,InputIt>::do_get (3) - Linux Manuals
std::num_get<CharT,InputIt>::get,std::num_get<CharT,InputIt>::do_get: std::num_get<CharT,InputIt>::get,std::num_get<CharT,InputIt>::do_get
NAME
std::num_get<CharT,InputIt>::get,std::num_get<CharT,InputIt>::do_get - std::num_get<CharT,InputIt>::get,std::num_get<CharT,InputIt>::do_get
Synopsis
public:
iter_type get( iter_type in, iter_type end, std::ios_base& str,
std::ios_base::iostate& err, bool& v ) const;
iter_type get( iter_type in, iter_type end, std::ios_base& str,
std::ios_base::iostate& err, long& v ) const;
iter_type get( iter_type in, iter_type end, std::ios_base& str,
std::ios_base::iostate& err, long long& v ) const;
iter_type get( iter_type in, iter_type end, std::ios_base& str,
std::ios_base::iostate& err, unsigned short& v ) const;
iter_type get( iter_type in, iter_type end, std::ios_base& str,
std::ios_base::iostate& err, unsigned int& v ) const;
iter_type get( iter_type in, iter_type end, std::ios_base& str,
std::ios_base::iostate& err, unsigned long& v ) const;
iter_type get( iter_type in, iter_type end, std::ios_base& str,
std::ios_base::iostate& err, unsigned long long& v ) const;
iter_type get( iter_type in, iter_type end, std::ios_base& str,
std::ios_base::iostate& err, float& v ) const;
iter_type get( iter_type in, iter_type end, std::ios_base& str,
std::ios_base::iostate& err, double& v ) const;
iter_type get( iter_type in, iter_type end, std::ios_base& str,
std::ios_base::iostate& err, long double& v ) const;
iter_type get( iter_type in, iter_type end, std::ios_base& str,
std::ios_base::iostate& err, void*& v ) const; (1)
protected:
virtual iter_type do_get( iter_type in, iter_type end, std::ios_base& str,
std::ios_base::iostate& err, bool& v ) const;
virtual iter_type do_get( iter_type in, iter_type end, std::ios_base& str,
std::ios_base::iostate& err, long& v ) const;
virtual iter_type do_get( iter_type in, iter_type end, std::ios_base& str,
std::ios_base::iostate& err, long long& v ) const;
virtual iter_type do_get( iter_type in, iter_type end, std::ios_base& str,
std::ios_base::iostate& err, unsigned short& v ) const;
virtual iter_type do_get( iter_type in, iter_type end, std::ios_base& str,
std::ios_base::iostate& err, unsigned int& v ) const;
virtual iter_type do_get( iter_type in, iter_type end, std::ios_base& str, (2)
std::ios_base::iostate& err, unsigned long& v ) const;
virtual iter_type do_get( iter_type in, iter_type end, std::ios_base& str,
std::ios_base::iostate& err, unsigned long long& v ) const;
virtual iter_type do_get( iter_type in, iter_type end, std::ios_base& str,
std::ios_base::iostate& err, float& v ) const;
virtual iter_type do_get( iter_type in, iter_type end, std::ios_base& str,
std::ios_base::iostate& err, double& v ) const;
virtual iter_type do_get( iter_type in, iter_type end, std::ios_base& str,
std::ios_base::iostate& err, long double& v ) const;
virtual iter_type do_get( iter_type in, iter_type end, std::ios_base& str,
std::ios_base::iostate& err, void*& v ) const;
1) Public member function, calls the member function do_get of the most derived class.
2) Reads characters from the input iterator in and generates the value of the type of v, taking into account IO stream formatting flags from str.flags(), character classification rules from std::use_facet<std::ctype<charT>>(str.getloc()), and numeric punctuation characters from std::use_facet<std::numpunct<charT>>(str.getloc()). This function is called by all formatted input stream operators such as std::cin >> n;.
Conversion occurs in three stages
Stage 1: conversion specifier selection
* I/O format flags are obtained, as if by
* If the type of v is an integer type, the the first applicable choice of the following five is selected:
* For integer types, length modifier is added to the conversion specification if necessary: h for short and unsigned short, l for long and unsigned long, ll for long long and unsigned long long
* If the type of v is float, will use conversion specifier %g
* If the type of v is double, will use conversion specifier %lg
* If the type of v is long double, will use conversion specifier %Lg
* If the type of v is void*, will use conversion specifier %p
* If the type of v is bool and boolalpha==0, proceeds as if the type of v is long, except for the value to be stored in v in stage 3.
* If the type of v is bool and boolalpha!=0, the following replaces stages 2 and 3:
Stage 2: character extraction
* If in==end, Stage 2 is terminated immediately, no further characters are extracted
* The next character is extracted from in as if by char_type ct = *in;
Stage 3: conversion and storage
* The sequence of chars accumulated in Stage 2 is converted to a numeric value