C++ named requirements: FormattedInputFunction
From cppreference.com
 
 
 
 
 
 C++ 
 Feature test macros (C++20)
 Concepts library (C++20)
 Metaprogramming library (C++11)
 Ranges library (C++20)
 Filesystem library (C++17)
 Concurrency support library (C++11)
 Execution control library (C++26)
C++ named requirements 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  
 
 
 
 
 
 
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
  (C++11)
(C++11)
(C++11)
(C++17)
(C++11)
  (C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++17)
(C++20)
FormattedInputFunction
(C++20)
(C++20)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
(C++14)
(C++14)
(C++11)
(C++11)
(C++17)
(C++14)
(C++20)
(C++20)
(C++23)
(C++23)
(C++23)
(C++11)
(C++11)
(C++11)
(C++11)
(C++11)
[edit] Requirements
A FormattedInputFunction is a stream input function that performs the following:
-  Constructs an object of type basic_istream::sentry with automatic storage duration and with the noskipwsargument set to false, which performs the following:
-  if eofbit or badbit are set on the input stream, sets the failbitas well, and if exceptions onfailbitare enabled in this input stream's exception mask ((exceptions() & failbit) != 0), throws ios_base::failure.
- flushes the tie()'d output stream, if applicable.
-  if ios_base::skipwsflag is set on this input stream, extracts and discards characters from the input stream until one of the following becomes true:
 - the next available character on the input stream is not a whitespace character, as tested by the std::ctype facet of the locale currently imbued in this input stream. The non-whitespace character is not extracted.
-  the end of the stream is reached, in which case failbitandeofbitare set and if the stream is on for exceptions on one of these bits, ios_base::failure is thrown.
 
 
-  if eofbit or badbit are set on the input stream, sets the 
-  Checks the status of the sentry by calling sentry::operator bool(), which is equivalent to basic_ios::good.
- If the sentry returned false or sentry's constructor threw an exception, no input takes place.
- If the sentry returned true, performs the input as if by calling rdbuf()->sbumpc() or rdbuf()->sgetc().
-  if the end of the stream is reached (the call to rdbuf()->sbumpc() or rdbuf()->sgetc() returns Traits::eof()), sets eofbit. If exceptions oneofbitare enabled in this stream's exception mask ((exceptions() & eofbit) != 0), throws ios_base::failure.
-  if an exception is thrown during input, sets badbitin the input stream. If exceptions onbadbitare enabled in this stream's exception mask ((exceptions() & badbit) != 0), the exception is also rethrown.
- If no exception was thrown, returns *this.
 
-  if the end of the stream is reached (the call to rdbuf()->sbumpc() or rdbuf()->sgetc() returns Traits::eof()), sets 
- In any event, whether terminating by exception or returning, the sentry's destructor is called before leaving this function.
[edit] Standard library
The following standard library functions are FormattedInputFunctions.
- basic_istream::operator>>(int, long, double, void*, bool)
- operator>>(std::basic_istream, char&)
- operator>>(std::basic_istream, char*)
- operator>>(std::basic_istream, std::bitset)
- operator>>(std::basic_istream, std::string)
-  operator>>, when called on the return value of std::get_money
[edit] Defect reports
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
| DR | Applied to | Behavior as published | Correct behavior | 
|---|---|---|---|
| LWG 160 | C++98 | the process of determining whether the exception caught is rethrown mentioned a non-existing function exception() | corrected to exceptions() |