Thread overview | |||||
---|---|---|---|---|---|
|
September 04, 2010 [phobos] hasElaborateCopyConstructor() | ||||
---|---|---|---|---|
| ||||
Is this the correct behavior for hasElaborateCopyConstructor()? Technically it seems to be right according to the documentation, but at the same time it seems substantially less useful. What users of this template probably really want to know is, "Is this object expensive to copy?". I guess I also have the same question for hasElaborateAssign. import std.traits; struct Postblit { this(this) {} } struct Wrapper { Postblit p; } static assert(hasElaborateCopyConstructor!Postblit); // Passes static assert(hasElaborateCopyConstructor!Wrapper); // FAILS |
September 04, 2010 [phobos] hasElaborateCopyConstructor() | ||||
---|---|---|---|---|
| ||||
Posted in reply to David Simcha | David Simcha wrote: > Is this the correct behavior for hasElaborateCopyConstructor()? No. > Technically it seems to be right according to the documentation, but > at the same time it seems substantially less useful. What users of > this template probably really want to know is, "Is this object > expensive to copy?". It means if the copy can be done with a simple memcpy. > I guess I also have the same question for hasElaborateAssign. > > import std.traits; > > struct Postblit { > this(this) {} > } > > struct Wrapper { > Postblit p; > } > > static assert(hasElaborateCopyConstructor!Postblit); // Passes > static assert(hasElaborateCopyConstructor!Wrapper); // FAILS > > > _______________________________________________ > phobos mailing list > phobos at puremagic.com > http://lists.puremagic.com/mailman/listinfo/phobos > > |
September 04, 2010 [phobos] hasElaborateCopyConstructor() | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Thanks for the clarification. Fixed. |
Copyright © 1999-2021 by the D Language Foundation