Steve Pope posted:
>>Is there a logic shift operator in C++? I tried ">>", it is an
arithmetic shift operator.
As far as I know, it's implementation-defined as to whether it's logical
shift or arithmetic shift.
No, there is no built-in logical shift right.
You could probably make one yourself by using a combination of things:
(1) Macros to determine whether the system is sign-magnitude, one's
complement or two's complement.
(2) Usage of the IMAX_BITS macro (you can do a Google Groups search for
this.)
(3) Usage of bitwise operators.
It wouldn't be a mammoth task.
--
Frederick Gotham