Reputation: 2955
I know the names of most of the operators but not sure what operator<<
and operator>>
are called.
i.e.
operator=() // the assignment operator
operator==() // the equality of comparison operator
operator++() // the increment operator
operator--() // decrement operator etc.
operator<() // the less-than operator
and so forth...
Upvotes: 26
Views: 39036
Reputation: 8720
They are called the Guillemet Left and Guillemet Right symbols :)
Upvotes: 0
Reputation: 54981
The original names were left shift operator (<<
) and right shift operator (>>
), but with their meanings perverted by streams into insertion and extraction, you could argue that even in bitwise operations <<
inserts bits on the right while >>
extracts them. Consequently, I almost always refer to them as the insertion and extraction operators.
Upvotes: 4
Reputation: 17557
In C++ Streams,
<<
is insertion operator.>>
is extraction operator.In Binary Operations,
Upvotes: 21
Reputation: 44776
<<
is both the insertion operator and the left-shift operator.
>>
is the extraction operator and the right-shift operator.
In the context of iostreams, they are considered to be stream insertion/extraction. In the context of bit-shifting, they are left-shift and right-shift.
Upvotes: 43
Reputation: 17039
<< is the 'left-shift' operator. It shifts its first operand left by the number of bits specified by its second operand.
Upvotes: 1