r175580 - Allow llvm::Optional to work with types without default constructors.

Jordan Rose jordan_rose at apple.com
Wed Feb 20 11:23:37 PST 2013


On Feb 19, 2013, at 18:20 , David Blaikie <dblaikie at gmail.com> wrote:

> 
> 
> 
> On Tue, Feb 19, 2013 at 6:15 PM, Jordan Rose <jordan_rose at apple.com> wrote:
> This is awesome. I think you need to write a move constructor now too, though—otherwise you'll end up with two complete objects being destructed. (Consider Optional<std::string>.)
> 
> I don't think I /need/ to write a move ctor, in the sense that the type won't get one for free (the conditions under which an implicit move ctor is provided are vanishingly rare) but it'd certainly be nice to have one.

Ah, whoops, forgot about the "no user-declared copy-constructors" requirement. Downgrade this to a Nice to Have, then. :-)

Jordan

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130220/475f1c39/attachment.html>


More information about the llvm-commits mailing list