yank '>>>'?
Michel Fortin
michel.fortin at michelf.com
Sun Dec 6 10:32:33 PST 2009
On 2009-12-06 12:36:49 -0500, dsimcha <dsimcha at yahoo.com> said:
> == Quote from bearophile (bearophileHUGS at lycos.com)'s article
>> Andrei Alexandrescu:
>>> Should we yank operator>>>?
>> We can change it purpose and add the other one:
>> <<< rotate left
>>>>> rotate right
>> Bye,
>> bearophile
>
> This is a good idea, although rotate may be seldom enough used not to
> warrant its
> own (possibly overloadable) operator. std.intrinsic might be a better
> place for
> rotate. On the other hand, rotate is a single ASM instruction, at
> least on x86.
> In a close to the metal language, there needs to be a straightforward,
> efficient
> way to access it.
The first time I searched for a way to rotate bits, I searched for an
operator and didn't find one (it was in C++ I think). So I wrote my own
function; it wasn't worth the time searching further.
I support <<< and >>> for rotate left and right, as an operator is the
most obvious place to look for such a basic operation.
--
Michel Fortin
michel.fortin at michelf.com
http://michelf.com/
More information about the Digitalmars-d
mailing list