std::basic_...ambuf::sync(3)
πΈ NAME πΈ
okay so this page is std::basic_streambuf::pubsync, std::basic_streambuf::sync β yes bestie, both of them, they're literally the same entry β straight out of the C++ Standard Libary manual (their spelling, not mine π
), section (3).
β¨ Synopsis β¨
here's the vibe, look:
int pubsync(); (1)
protected: (2)
virtual int sync();
so what it does: it synchronizes the controlled character sequence (that's the buffers, bestie) with the associated character sequence. iconic behavior honestly.
- calls
sync()of the most derived class π«Ά - the base class version of this function has no effect. derived classes may override this function to allow synchronizing the underlying device with the buffers.
for output streams, this typically results in writing the contents of the put area into the associated sequence, i.e. flushing of the output buffer π₯. for input streams, this typically empties the get area and forces a re-read from the associated sequence to pick up recent changes. the default behavior (found, for example, in std::basic_stringbuf) is to do nothing π like it literally sits there. main character energy of a function that does nothing.
π Parameters π
- (none) β not a single one. she takes zero arguments. unbothered. π
π Return value π
- the return value of
sync(). - returns
0on success,-1otherwise. the base class version returns0.
so like,0= slay,-1= not slay. keep that in mind fr fr.
π¦ Example π¦
- This section is incomplete
- Reason: no example
no example yet π the cppreference girlies haven't finished it. we wait. π§
β See also β
syncβ synchronizes with the underlying storage device (public member function ofstd::basic_istream<CharT,Traits>)syncβ writes characters to the associated file from the put area [virtual] (virtual protected member function ofstd::basic_filebuf<CharT,Traits>)
π Category π
- Todo no example
and that's the whole page bestie, no cap π
π cute lil sign-off: this one came fromhttp://cppreference.comand it's dated2024.06.10β so if anything's changed since, that's on them, not me πβ¨
π¦ 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