bison-patches
[Top][All Lists]
Advanced

[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:10:23 +0200

> On 12 Sep 2018, at 07:06, Akim Demaille <address@hidden> wrote:
> 
> Here is my updated proposal.
> 
> commit 4ba0a5eac0953e308128af23324103f9589dc37e
> Author: Akim Demaille <address@hidden>
> Date:   Sun Aug 12 18:05:47 2018 +0200
> 
>    lalr1.cc: support move semantics
> 
>    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++11 introduced "move only" types that can never be duplicated and must be 
moved, for example, std::unique_ptr<T>. This commit ensures that lalr1.cc 
invokes such move operators when available, that is, when compiled using C++11 
or later, and when defined for the involved types. When compiled using 
C++98/C++03, the behavior is as before.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]