std::streamsize(3)
πΈ std::streamsize β NAME, but make it cute πΈ
okay so real talk, this is the std::streamsize(3) page from the C++ Standard Library, bestie. the literal name of the whole thing is std::streamsize β that's it, that's the name, no notes. she's a type, she's iconic, let's get into it π
β¨ SYNOPSIS β¨
so she lives in a header, like every good C++ girlie does:
Defined in header <ios>
typedef /*implementation-defined*/ streamsize;
that's the whole synopsis fr fr. one typedef and a vibe π
π¦ DESCRIPTION π¦
okay so, std::streamsize β hear me out β is an implementation-defined signed integral type. like, the standard literally says "we're not telling you exactly what it is, that's up to your implementation," iykyk. so don't go assuming a bit width, because she will not confirm it π«Ά
and what does she do? she represents the number of characters transferred in an I/O operation, or the size of an I/O buffer. that's her whole job. that's the assignment and she ate π―
think of her as the signed counterpart of std::size_t β very "same energy, but she can go negative" β similar to the POSIX type ssize_t. ngl that comparison is doing a lot of work but it's true β¨
π¨ okay bestie, caveat time, do NOT skip this: except in the constructors ofstd::strstreambuf, negative values ofstd::streamsizeare never used. like, never ever. so if you see a negativestreamsizefloating around outsidestd::strstreambufconstructors, something has gone deeply wrong and you should probably call someone π
π SEE ALSO π
these are the main character functions that fw her, all of them public member functions of std::basic_istream<CharT,Traits> unless I say otherwise:
gcountβ returns the number of characters extracted by the last unformatted input operation π (public member function ofstd::basic_istream<CharT,Traits>)ignoreβ extracts and discards characters until the given character is found π (public member function ofstd::basic_istream<CharT,Traits>)readβ extracts blocks of characters π (public member function ofstd::basic_istream<CharT,Traits>)writeβ inserts blocks of characters βοΈ (public member function ofstd::basic_ostream<CharT,Traits>β yes, notice she's an ostream one, lowkey the odd one out and we respect her for it π)
and that's the page!! no cap, that's literally all of it π§
π little sign-off from your girl: this one's fromhttp://cppreference.com, dated2024.06.10, and it's pagestd::streamsize(3)of the C++ Standard Library. go forth and stream responsibly, bestie ππ
π¦ 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