Add a polymorphic_ptr<T> smart pointer data type. It's a somewhat silly
authorChandler Carruth <chandlerc@gmail.com>
Sat, 9 Nov 2013 04:06:02 +0000 (04:06 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sat, 9 Nov 2013 04:06:02 +0000 (04:06 +0000)
commitaec427786be4f4dd0c8ecc0aa17899e6c836e45d
treecb5b1da86d2d4d32929e7baecaabbdde7d300dfc
parent332cbf1d4503fcad3b5f3bf6ff73889feff03ad7
Add a polymorphic_ptr<T> smart pointer data type. It's a somewhat silly
unique ownership smart pointer which is *deep* copyable by assuming it
can call a T::clone() method to allocate a copy of the owned data.

This is mostly useful with containers or other collections of uniquely
owned data in C++98 where they *might* copy. With C++11 we can likely
remove this in favor of move-only types and containers wrapped around
those types.

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