This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [v3] is_modulo


On Sat, Apr 28, 2012 at 6:45 PM, Marc Glisse <marc.glisse@inria.fr> wrote:
> On Sat, 28 Apr 2012, Gabriel Dos Reis wrote:
>
>> On Sat, Apr 28, 2012 at 5:41 PM, Marc Glisse <marc.glisse@inria.fr> wrote:
>>>
>>> Hello,
>>>
>>> the attached follows the precisions on the definition of is_modulo in DR
>>> 612. I believe this is what the values always should have been, so I
>>> didn't
>>> make the change conditional to C++11.
>>
>>
>> Thanks for the patch.
>> I think ?'char' shouldn't be considered modulo ?even if
>> -funsigned-char -- I will bring this to LWG attention.
>
>
> Why not? If an implementation decides to guarantee that the arithmetic on a
> type is modular, it should advertise it through this trait, I don't see
> anything wrong about that. Well, doing arithmetic on char may not be the
> best idea, but still...

(1) char really is a character type, it is an 'accident' that it is
classified as arithmetic type.
(2) there is no arithmetic operation on char: the arithmetic is done
on a different type
      and the result clamped back to char.

> Actually, if you are going to bring this up in LWG,
> let's not discuss that here.

Exactly.

>
>> OK.
>
>
> Note that I can't commit, you'll have to do it, sorry...
>
> --
> Marc Glisse


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]