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)
commita28eda7e401f37a2fe42ca9bba96b6e662b60cf0
tree3280d2d2f26755931bfe557d97034f8a16b1b3a8
parent9bc2c994827f2ff881d0563f0c14134b794b4928
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175580 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/Optional.h
unittests/ADT/CMakeLists.txt
unittests/ADT/OptionalTest.cpp [new file with mode: 0644]