Allow llvm::Optional to work with types without default constructors.
authorDavid Blaikie <dblaikie@gmail.com>
Wed, 20 Feb 2013 00:26:04 +0000 (00:26 +0000)
committerDavid Blaikie <dblaikie@gmail.com>
Wed, 20 Feb 2013 00:26:04 +0000 (00:26 +0000)
commit77bac3dbcc2efde5be60ac93acbad0b3e60b0c43
treed65eaa02d75d88ca20d86e1d5508454942831f4d
parent6605c604b9ceef7007cd099b483a252b4b1d5d36
Allow llvm::Optional to work with types without default constructors.

This generalizes Optional to require less from the T type by using aligned
storage for backing & placement new/deleting the T into it when necessary.

Also includes unit tests.

llvm-svn: 175580
llvm/include/llvm/ADT/Optional.h
llvm/unittests/ADT/CMakeLists.txt
llvm/unittests/ADT/OptionalTest.cpp [new file with mode: 0644]