operator(3)

πŸ“¦ version 1.6, in fedora 43, fedora 44

πŸ’– operator(3) πŸ’–

okay so bestie, we're deep in the gstream manual rn and this page is literally about the << and >> operators. buckle up πŸŽ€


✨ NAME ✨

operator, operator β€” yes it's listed twice, that's not a typo, that's just how it is, slay πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <gstream.h>

ostream& operator<<(ostream& o, fix const& x);

istream& operator>>(istream& i, fix& x);

like, that's the whole vibe. two little functions. iconic.


🌸 DESCRIPTION 🌸

okay so real talk β€” these two functions don't actually belong to the gstreams. they're just chilling here because they sometimes make life a bit easier. and the best part? they don't cost anything in executable size if they are left unused. free real estate, no cap 🫢

their whole purpose is to make the class fix capable of extracting and inserting with this notation:

fix a_number = 0.3;
cout << a_number;
cin >> a_number;

in conjuction with the standard stream system. ✨ and btw, consequently it also works in conjuction with a gstream:

gstream gs;
gs << a_number;
gs >> a_number;

okay and listen β€” you are probably not interested in calling them with their function names, only with the << / >> operators. so this whole paragraph exists just to make you aware of the possibility of doing that. like, the option is there, the door is open, do with that information what you will πŸ’œ

not me explaining operators like they're a personality trait 😭 but fr fr, that's the whole page.

πŸ’« sign-off πŸ’«

that's a wrap, bestie!! this was gstream version 1.6, page operator(3) β€” go forth and stream your fix values with main character energy πŸ‘‘πŸŒˆβ­

πŸ“¦ where this page comes from