[phobos] hasElaborateCopyConstructor()

David Simcha dsimcha at gmail.com
Sat Sep 4 09:08:36 PDT 2010


  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




More information about the phobos mailing list