[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: RFC: lalr1.cc: support move semantics
From: |
Hans Åberg |
Subject: |
Re: RFC: lalr1.cc: support move semantics |
Date: |
Wed, 12 Sep 2018 23:54:24 +0200 |
> On 12 Sep 2018, at 23:46, Frank Heckenbach <address@hidden> wrote:
>
> Hans Åberg wrote:
>
>>>>> Modern C++ (i.e., C++11 and later) introduced "move only" types: types
>>>>> such
>>>>> as std::unique_ptr<T> that can never be duplicated. They must never be
>>>>> copied (by assignments and constructors), they must be "moved". The
>>>>> implementation of lalr1.cc used to copy symbols (including their semantic
>>>>> values). This commit ensures that values are only moved in modern C++,
>>>>> yet
>>>>> remain compatible with C++98/C++03.
>>>>
>>>> Hopefully copy only types can still be used. So say:
>>>
>>> C++ will automatically copy when copy is available and move is not.
>>
>> Yes, but strictly, that is not what the above text says.
>
> Depends on your definitions. IMHO in (modern) C++ "move" always
> implies "copy" if possible and necessary,
But that does not mean that a move operator is a copy operators, only that
another is used.
> though I wouldn't object
> to spelling it out here.
It is written in a pedagogical style intended for those that may not know. For
those that do know, it suffices:
This commit introduces C++11 move operators, while retaining the behavior under
C++98/C++03.
- Re: RFC: lalr1.cc: support move semantics, (continued)
- Re: RFC: lalr1.cc: support move semantics, Frank Heckenbach, 2018/09/11
- Re: RFC: lalr1.cc: support move semantics, Akim Demaille, 2018/09/11
- Re: RFC: lalr1.cc: support move semantics, Frank Heckenbach, 2018/09/11
- Re: RFC: lalr1.cc: support move semantics, Akim Demaille, 2018/09/12
- Re: RFC: lalr1.cc: support move semantics, Akim Demaille, 2018/09/12
- Re: RFC: lalr1.cc: support move semantics, Akim Demaille, 2018/09/12
- Re: RFC: lalr1.cc: support move semantics, Hans Åberg, 2018/09/12
- Re: RFC: lalr1.cc: support move semantics, Frank Heckenbach, 2018/09/12
- Re: RFC: lalr1.cc: support move semantics, Hans Åberg, 2018/09/12
- Re: RFC: lalr1.cc: support move semantics, Frank Heckenbach, 2018/09/12
- Re: RFC: lalr1.cc: support move semantics,
Hans Åberg <=
- Re: RFC: lalr1.cc: support move semantics, Hans Åberg, 2018/09/12
- Re: RFC: lalr1.cc: support move semantics, Akim Demaille, 2018/09/13
- Re: RFC: lalr1.cc: support move semantics, Hans Åberg, 2018/09/13
- Re: RFC: lalr1.cc: support move semantics, Frank Heckenbach, 2018/09/13
- Re: RFC: lalr1.cc: support move semantics, Akim Demaille, 2018/09/13
- Re: C++ preferences (was: RFC: lalr1.cc: support move semantics), Frank Heckenbach, 2018/09/12
- Re: C++ preferences (was: RFC: lalr1.cc: support move semantics), Akim Demaille, 2018/09/13
- Re: C++ preferences, Hans Åberg, 2018/09/13
- Re: C++ preferences, Akim Demaille, 2018/09/13
- Re: C++ preferences, Hans Åberg, 2018/09/13