std::basic_ios::basic_ios(3)
π std::basic_ios::basic_ios π
Ok so welcome to the C++ Standard Libary manpage for std::basic_ios::basic_ios(3) β constructor edition, and yes, we are getting into it. π
π NAME π
std::basic_ios::basic_ios β this is the constructor page for std::basic_ios, bestie. That's the name, that's the vibe. π«Ά
β¨ Synopsis β¨
It literally constructs a new std::basic_ios object. Here's the signature situation, exactly as the manual lays it out:
protected: (1)
basic_ios();
public: (2)
explicit basic_ios( std::basic_streambuf<CharT, Traits>* sb );
private:
(until C++11)
basic_ios( const basic_ios& ); (3)
public:
(since C++11)
basic_ios( const basic_ios& ) = delete;
The numbered tea β:
- Default constructor β the internal state is not initialized.
init()must be called before the first use of the object or before the destructor, otherwise the behavior is undefined. No cap, that's a real "handle your initialization" warning. π basic_ios( std::basic_streambuf<CharT, Traits>* sb )β initializes the internal state by callinginit(sb). The associated stream buffer is set tosb.- Copy constructor β it's declared
privateand not defined (until C++11), and since C++11 it's explicitly defined as deleted. The reason is iconic: I/O streams are notCopyConstructible. Periodt. π
πΈ Parameters πΈ
sbβ stream buffer to associate to. That's the whole parameter list, and she's doing her job. π¦
π Defect reports π
The following behavior-changing defect reports were applied retroactively to previously published C++ standards:
- DR
LWG 1249β applied toC++98. Behavior as published: internal state did not need to be initialized before first use. Correct behavior: also needs to be initialized. π
π that's the whole page, bestie β source: http://cppreference.com, version/date: 2024.06.10. Now go initialize your internal state before first use, fr fr. π
β¨
π¦ where this page comes from
- nixpkgs unstable: stdman 2024.07.05
- opensuse-leap 16.0: stdman 2024.07.05-bp160.1.9 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms