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: [cxx-conversion] Make double_int a class with methods and operators. (issue6443093)


On Thu, Aug 9, 2012 at 12:25 AM, Lawrence Crowl <crowl@google.com> wrote:
> On 8/8/12, Richard Guenther <richard.guenther@gmail.com> wrote:
>> On Aug 7, 2012 Lawrence Crowl <crowl@google.com> wrote:
>> > We should probably think about naming conventions for mutating
>> > operations, as I expect we will want them eventually.
>>
>> Right.  In the end I would prefer explicit constructors.
>
> I don't think we're thinking about the same thing.
>
> I'm talking about member functions like mystring.append ("foo").
> The += operator is mutating as well.
>
> Constructors do not mutate, they create.

Ah.  For simple objects like double_int I prefer to have either all ops mutating
or all ops non-mutating.

Richard.

> --
> Lawrence Crowl


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