Re: hasElaborateCopyConstructor bug?

2019-06-02 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, June 2, 2019 1:29:22 PM MDT Jonathan M Davis via Digitalmars-d- learn wrote: > On Sunday, June 2, 2019 8:32:16 AM MDT Paul Backus via Digitalmars-d-learn > wrote: > > On Sunday, 2 June 2019 at 06:59:02 UTC, Jonathan M Davis wrote: > > > Almost certainly, hasElaborateCopyConstructor

Re: hasElaborateCopyConstructor bug?

2019-06-02 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, June 2, 2019 8:32:16 AM MDT Paul Backus via Digitalmars-d-learn wrote: > On Sunday, 2 June 2019 at 06:59:02 UTC, Jonathan M Davis wrote: > > Almost certainly, hasElaborateCopyConstructor should be updated > > to test for both postblit constructors and copy constructors, > > since its

Re: hasElaborateCopyConstructor bug?

2019-06-02 Thread Paul Backus via Digitalmars-d-learn
On Sunday, 2 June 2019 at 14:44:47 UTC, H. S. Teoh wrote: On Sun, Jun 02, 2019 at 02:32:16PM +, Paul Backus via Digitalmars-d-learn wrote: [...] If std.v2 ever materializes, we'll have an opportunity to fix papercuts like this. Until then, my preferred workaround is to use a renaming

Re: hasElaborateCopyConstructor bug?

2019-06-02 Thread H. S. Teoh via Digitalmars-d-learn
On Sun, Jun 02, 2019 at 02:32:16PM +, Paul Backus via Digitalmars-d-learn wrote: [...] > If std.v2 ever materializes, we'll have an opportunity to fix > papercuts like this. Until then, my preferred workaround is to use a > renaming import: > > import std.traits: hasNontrivialCopy =

Re: hasElaborateCopyConstructor bug?

2019-06-02 Thread Paul Backus via Digitalmars-d-learn
On Sunday, 2 June 2019 at 06:59:02 UTC, Jonathan M Davis wrote: Almost certainly, hasElaborateCopyConstructor should be updated to test for both postblit constructors and copy constructors, since its purpose is to test for whether the type has a user-defined copying function [...] Whether

Re: hasElaborateCopyConstructor bug?

2019-06-02 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, June 1, 2019 5:29:08 PM MDT SrMordred via Digitalmars-d-learn wrote: > On Saturday, 1 June 2019 at 21:39:33 UTC, SImen Kjærås wrote: > > On Saturday, 1 June 2019 at 21:05:32 UTC, SrMordred wrote: > > > > hasElaborateCopyConstructor checks if the type defines a > > postblit[0]. > >

Re: hasElaborateCopyConstructor bug?

2019-06-01 Thread SrMordred via Digitalmars-d-learn
On Sunday, 2 June 2019 at 04:02:08 UTC, Paul Backus wrote: On Saturday, 1 June 2019 at 23:29:08 UTC, SrMordred wrote: On Saturday, 1 June 2019 at 21:39:33 UTC, SImen Kjærås wrote: On Saturday, 1 June 2019 at 21:05:32 UTC, SrMordred wrote: Haven't tested it extensively, so use at your own

Re: hasElaborateCopyConstructor bug?

2019-06-01 Thread Paul Backus via Digitalmars-d-learn
On Saturday, 1 June 2019 at 23:29:08 UTC, SrMordred wrote: On Saturday, 1 June 2019 at 21:39:33 UTC, SImen Kjærås wrote: On Saturday, 1 June 2019 at 21:05:32 UTC, SrMordred wrote: hasElaborateCopyConstructor checks if the type defines a postblit[0]. Yes, I know this. But since dmd 2.086

Re: hasElaborateCopyConstructor bug?

2019-06-01 Thread SrMordred via Digitalmars-d-learn
On Saturday, 1 June 2019 at 21:39:33 UTC, SImen Kjærås wrote: On Saturday, 1 June 2019 at 21:05:32 UTC, SrMordred wrote: hasElaborateCopyConstructor checks if the type defines a postblit[0]. Yes, I know this. But since dmd 2.086 we have copy ctors:

Re: hasElaborateCopyConstructor bug?

2019-06-01 Thread SImen Kjærås via Digitalmars-d-learn
On Saturday, 1 June 2019 at 21:05:32 UTC, SrMordred wrote: import std.traits; struct T { this(ref return scope T other){} } pragma(msg, hasElaborateCopyConstructor!T); //false hasElaborateCopyConstructor checks if the type defines a postblit[0]. That is, a function called this(this).

hasElaborateCopyConstructor bug?

2019-06-01 Thread SrMordred via Digitalmars-d-learn
import std.traits; struct T { this(ref return scope T other){} } pragma(msg, hasElaborateCopyConstructor!T); //false