STD::BASIC_ISTREAM_SENTRY(3cxx)
β¨ NAME β¨
okay so bestie, this is the 3cxx manual page for std::basic_istream< _CharT, _Traits >::sentry β the lil setup gremlin that gets input streams ready before the standard extractors do their thing. It performs setup work for input streams. π
π SYNOPSIS π
#include <istream>
π Public Types π
typedef __istream_type::__ctype_type __ctype_typetypedef _Traits::int_type __int_typetypedef basic_istream< _CharT, _Traits > __istream_typetypedef basic_streambuf< _CharT, _Traits > __streambuf_typetypedef _Traits traits_typeβ easy access to dependent types. π«Ά
πΈ Public Member Functions πΈ
sentry (basic_istream< _CharT, _Traits > &__is, bool __noskipws=false)β the constructor performs all the work. no cap.operator bool () constβ quick status checking. π
π¦ Detailed Description π¦
template<typename _CharT, typename _Traits>
class std::basic_istream< _CharT, _Traits >::sentry
βPerforms setup work for input streams.β β¨
Objects of this class are created before all of the standard extractors are run. It is responsible for exception-safe prefix and suffix operations, although only prefix actions are currently required by the standard. lowkey iconic. π
π Member Typedef Documentation π
template<typename _CharT , typename _Traits > typedef _Traits std::basic_istream< _CharT, _Traits >::sentry::traits_type
Easy access to dependent types. periodt. π
π₯ Constructor & Destructor Documentation π₯
template<typename _CharT , typename _Traits > std::basic_istream< _CharT, _Traits >::sentry::sentry (basic_istream< _CharT, _Traits > & __is, bool __noskipws = false) [explicit]
The constructor performs all the work. sheβs the main character of setup. π
π¬ Parameters π¬
__isβ The input stream to guard.__noskipwsβ Whether to consume whitespace or not.
If the stream state is good (__is.good() is true), then the following actions are performed, otherwise the sentry state is false (not okay) and failbit is set in the stream state. vibe check failed, bestie. π
The sentryβs preparatory actions are:
- if the stream is tied to an output stream,
is.tie()->flush()is called to synchronize the output sequence - if
__noskipwsis false, andios_base::skipwsis set inis.flags(), the sentry extracts and discards whitespace characters from the stream. The currently imbued locale is used to determine whether each character is whitespace.
If the stream state is still good, then the sentry state becomes true (okay). slay. β
References std::ios_base::badbit, std::ios_base::eofbit, std::ios_base::failbit, std::ios_base::flags(), std::basic_ios< _CharT, _Traits >::good(), std::ios_base::goodbit, std::basic_ios< _CharT, _Traits >::rdbuf(), std::basic_ios< _CharT, _Traits >::setstate(), std::ios_base::skipws, and std::basic_ios< _CharT, _Traits >::tie().
β Member Function Documentation β
template<typename _CharT , typename _Traits > std::basic_istream< _CharT, _Traits >::sentry::operator bool () const [inline], [explicit]
Quick status checking. π΅οΈββοΈ
π Returns π
The sentry state.
For ease of use, sentries may be converted to booleans. The return value is that of the sentry state (true == okay). iykyk. πΏ
π Author π
Generated automatically by Doxygen for libstdc++ from the source code. not me being auto-generated and still serving. π
xoxo, your 3cxx bestie π β source/version: libstdc++; footer date: the one stamped on your copy, periodt. π«Ά
π¦ where this page comes from
- ubuntu noble: libstdc++-14-doc 14-20240412-0ubuntu1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms