3 ms·
For those of you who like me didn't know about this, operators <<= and >>= exist, can be overloaded, and do "bitwise shift assignment". |a <<= b| is the same a
by reubenmorais 13y ago
For those of you who like me didn't know about this, operators <<= and >>= exist, can be overloaded, and do "bitwise shift assignment".
|a <<= b| is the same as |a = a << b|
- jxf 13y agoDoes |x| mean something specific here in C++ that I'm not aware of, or are you just using it to bracket the expressions?
- adamnemecek 13y agoThe latter.
- banachtarski 13y agoWell, yes that's true, but in the context of "monadic lifting" >>= refers to the monadic bind operator.
- adamnemecek 13y agoCorrect but in order for an operator to be overloadable in C++, it must have a meaning in standard C++ as well. The comment was pointing out that it's surprising that >>= is an operator in standard C++.
- banachtarski 13y agoOh my mistake, I actually use >>= and <<= frequently.