* <code>if (!a_stream) ...</code> and <code>while (a_stream) ...</code>
*/
#if __cplusplus >= 201103L
+ _GLIBCXX_NODISCARD
explicit operator bool() const
{ return !this->fail(); }
#else
{ return this->fail() ? 0 : const_cast<basic_ios*>(this); }
#endif
+ _GLIBCXX_NODISCARD
bool
operator!() const
{ return this->fail(); }
* See std::ios_base::iostate for the possible bit values. Most
* users will call one of the interpreting wrappers, e.g., good().
*/
+ _GLIBCXX_NODISCARD
iostate
rdstate() const
{ return _M_streambuf_state; }
*
* A wrapper around rdstate.
*/
+ _GLIBCXX_NODISCARD
bool
good() const
{ return this->rdstate() == 0; }
*
* Note that other iostate flags may also be set.
*/
+ _GLIBCXX_NODISCARD
bool
eof() const
{ return (this->rdstate() & eofbit) != 0; }
* Checking the badbit in fail() is historical practice.
* Note that other iostate flags may also be set.
*/
+ _GLIBCXX_NODISCARD
bool
fail() const
{ return (this->rdstate() & (badbit | failbit)) != 0; }
*
* Note that other iostate flags may also be set.
*/
+ _GLIBCXX_NODISCARD
bool
bad() const
{ return (this->rdstate() & badbit) != 0; }
* This changes nothing in the stream. See the one-argument version
* of exceptions(iostate) for the meaning of the return value.
*/
+ _GLIBCXX_NODISCARD
iostate
exceptions() const
{ return _M_exception; }
* stream. When this stream performs any I/O, the tied stream is
* first flushed. For example, @c std::cin is tied to @c std::cout.
*/
+ _GLIBCXX_NODISCARD
basic_ostream<_CharT, _Traits>*
tie() const
{ return _M_tie; }
*
* This does not change the state of the stream.
*/
+ _GLIBCXX_NODISCARD
basic_streambuf<_CharT, _Traits>*
rdbuf() const
{ return _M_streambuf; }
*
* It defaults to a space (' ') in the current locale.
*/
+ _GLIBCXX_NODISCARD
char_type
fill() const
{
* @brief Access to format flags.
* @return The format control flags for both input and output.
*/
+ _GLIBCXX_NODISCARD
fmtflags
flags() const
{ return _M_flags; }
* Be careful if you try to give a definition of @a precision here; see
* DR 189.
*/
+ _GLIBCXX_NODISCARD
streamsize
precision() const
{ return _M_precision; }
*
* <em>Minimum field width</em> refers to the number of characters.
*/
+ _GLIBCXX_NODISCARD
streamsize
width() const
{ return _M_width; }
* returns @c loc. Otherwise, it returns a copy of @c std::locale(),
* the global C++ locale.
*/
+ _GLIBCXX_NODISCARD
locale
getloc() const
{ return _M_ios_locale; }
/**
* @brief Returns true if the external file is open.
*/
+ _GLIBCXX_NODISCARD
bool
is_open() const throw()
{ return _M_file.is_open(); }
*
* This hides both signatures of std::basic_ios::rdbuf().
*/
+ _GLIBCXX_NODISCARD
__filebuf_type*
rdbuf() const
{ return const_cast<__filebuf_type*>(&_M_filebuf); }
* @brief Wrapper to test for an open file.
* @return @c rdbuf()->is_open()
*/
+ _GLIBCXX_NODISCARD
bool
is_open()
{ return _M_filebuf.is_open(); }
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 365. Lack of const-qualification in clause 27
+ _GLIBCXX_NODISCARD
bool
is_open() const
{ return _M_filebuf.is_open(); }
*
* This hides both signatures of std::basic_ios::rdbuf().
*/
+ _GLIBCXX_NODISCARD
__filebuf_type*
rdbuf() const
{ return const_cast<__filebuf_type*>(&_M_filebuf); }
* @brief Wrapper to test for an open file.
* @return @c rdbuf()->is_open()
*/
+ _GLIBCXX_NODISCARD
bool
is_open()
{ return _M_filebuf.is_open(); }
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 365. Lack of const-qualification in clause 27
+ _GLIBCXX_NODISCARD
bool
is_open() const
{ return _M_filebuf.is_open(); }
*
* This hides both signatures of std::basic_ios::rdbuf().
*/
+ _GLIBCXX_NODISCARD
__filebuf_type*
rdbuf() const
{ return const_cast<__filebuf_type*>(&_M_filebuf); }
* @brief Wrapper to test for an open file.
* @return @c rdbuf()->is_open()
*/
+ _GLIBCXX_NODISCARD
bool
is_open()
{ return _M_filebuf.is_open(); }
// _GLIBCXX_RESOLVE_LIB_DEFECTS
// 365. Lack of const-qualification in clause 27
+ _GLIBCXX_NODISCARD
bool
is_open() const
{ return _M_filebuf.is_open(); }
}
// [spanbuf.members], member functions
+ [[nodiscard]]
std::span<_CharT>
span() const noexcept
{
}
// [ispanstream.members], member functions
+ [[nodiscard]]
basic_spanbuf<_CharT, _Traits>*
rdbuf() const noexcept
{
return const_cast<basic_spanbuf<_CharT, _Traits>*>(std::__addressof(_M_sb));
}
+ [[nodiscard]]
std::span<const _CharT>
span() const noexcept
{ return _M_sb.span(); }
}
// [ospanstream.members], member functions
+ [[nodiscard]]
basic_spanbuf<_CharT, _Traits>*
rdbuf() const noexcept
{
return const_cast<basic_spanbuf<_CharT, _Traits>*>(std::__addressof(_M_sb));
}
+ [[nodiscard]]
std::span<_CharT>
span() const noexcept
{ return _M_sb.span(); }
}
// [spanstream.members], members
+ [[nodiscard]]
basic_spanbuf<_CharT, _Traits>*
rdbuf() const noexcept
{
return const_cast<basic_spanbuf<_CharT, _Traits>*>(std::__addressof(_M_sb));
}
+ [[nodiscard]]
std::span<_CharT>
span() const noexcept
{ return _M_sb.span(); }
* character sequence is equal to the input sequence; otherwise, it
* is equal to the output sequence.</em> [27.7.1.2]/1
*/
+ _GLIBCXX_NODISCARD
__string_type
str() const _GLIBCXX_LVAL_REF_QUAL
{
#if _GLIBCXX_USE_CXX11_ABI
#if __cpp_concepts
template<__allocator_like _SAlloc>
+ _GLIBCXX_NODISCARD
basic_string<_CharT, _Traits, _SAlloc>
str(const _SAlloc& __sa) const
{
}
#endif
+ _GLIBCXX_NODISCARD
__string_type
str() &&
{
*
* This hides both signatures of std::basic_ios::rdbuf().
*/
+ _GLIBCXX_NODISCARD
__stringbuf_type*
rdbuf() const
{ return const_cast<__stringbuf_type*>(&_M_stringbuf); }
* @brief Copying out the string buffer.
* @return @c rdbuf()->str()
*/
+ _GLIBCXX_NODISCARD
__string_type
str() const _GLIBCXX_LVAL_REF_QUAL
{ return _M_stringbuf.str(); }
#if _GLIBCXX_USE_CXX11_ABI
#if __cpp_concepts
template<__allocator_like _SAlloc>
+ _GLIBCXX_NODISCARD
basic_string<_CharT, _Traits, _SAlloc>
str(const _SAlloc& __sa) const
{ return _M_stringbuf.str(__sa); }
#endif
+ _GLIBCXX_NODISCARD
__string_type
str() &&
{ return std::move(_M_stringbuf).str(); }
*
* This hides both signatures of std::basic_ios::rdbuf().
*/
+ _GLIBCXX_NODISCARD
__stringbuf_type*
rdbuf() const
{ return const_cast<__stringbuf_type*>(&_M_stringbuf); }
* @brief Copying out the string buffer.
* @return @c rdbuf()->str()
*/
+ _GLIBCXX_NODISCARD
__string_type
str() const _GLIBCXX_LVAL_REF_QUAL
{ return _M_stringbuf.str(); }
#if _GLIBCXX_USE_CXX11_ABI
#if __cpp_concepts
template<__allocator_like _SAlloc>
+ _GLIBCXX_NODISCARD
basic_string<_CharT, _Traits, _SAlloc>
str(const _SAlloc& __sa) const
{ return _M_stringbuf.str(__sa); }
#endif
+ _GLIBCXX_NODISCARD
__string_type
str() &&
{ return std::move(_M_stringbuf).str(); }
*
* This hides both signatures of std::basic_ios::rdbuf().
*/
+ _GLIBCXX_NODISCARD
__stringbuf_type*
rdbuf() const
{ return const_cast<__stringbuf_type*>(&_M_stringbuf); }
* @brief Copying out the string buffer.
* @return @c rdbuf()->str()
*/
+ _GLIBCXX_NODISCARD
__string_type
str() const _GLIBCXX_LVAL_REF_QUAL
{ return _M_stringbuf.str(); }
#if _GLIBCXX_USE_CXX11_ABI
#if __cpp_concepts
template<__allocator_like _SAlloc>
+ _GLIBCXX_NODISCARD
basic_string<_CharT, _Traits, _SAlloc>
str(const _SAlloc& __sa) const
{ return _M_stringbuf.str(__sa); }
#endif
+ _GLIBCXX_NODISCARD
__string_type
str() &&
{ return std::move(_M_stringbuf).str(); }
// process alphanumeric versions of bool values
is_02.setf(std::ios_base::boolalpha);
- is_02.flags();
+ (void) is_02.flags();
is_02 >> b1;
VERIFY( b1 == 1 );
is_02 >> b1;
// process numeric versions of of bool values
is_02.unsetf(std::ios_base::boolalpha);
- is_02.flags();
+ (void) is_02.flags();
is_02 >> b1;
VERIFY( b1 == 0 );
is_02 >> b1;
// process alphanumeric versions of bool values
is_02.setf(std::ios_base::boolalpha);
- is_02.flags();
+ (void) is_02.flags();
is_02 >> b1;
VERIFY( b1 == 1 );
is_02 >> b1;
// process numeric versions of of bool values
is_02.unsetf(std::ios_base::boolalpha);
- is_02.flags();
+ (void) is_02.flags();
is_02 >> b1;
VERIFY( b1 == 0 );
is_02 >> b1;