My question is therefore, is this by design? Can I rely on this to work in the future, and on all compilers? If this is the case, it really should be added to the spec. (Or maybe it's there already, but I couldn't find it.)Lars
Funny you should ask: http://d.puremagic.com/issues/show_bug.cgi?id=11287According to the conversation, NRVO is supposed to be part of the spec, and you should expect it to work.