[PATCH] D51525: [ADT] Add a new class OwnedOrBorrowed<T>

Zachary Turner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 31 09:05:48 PDT 2018


zturner updated this revision to Diff 163545.
zturner added a comment.

1. Changed the name to `MaybeOwned`.
2. Made constructors implicit (It's nice to be able to write a class with a constructor like `Foo(MaybeOwne<T>)` and be able to create it as `Foo F(std::move(UniquePtr));`.
3. Added an `enable_if` clause to the constructor so that `unique_ptr<U>` can be used whenever it's convertible to `unique_ptr<T>`


https://reviews.llvm.org/D51525

Files:
  llvm/include/llvm/ADT/MaybeOwned.h
  llvm/unittests/ADT/CMakeLists.txt
  llvm/unittests/ADT/MaybeOwnedTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D51525.163545.patch
Type: text/x-patch
Size: 5495 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180831/024a8784/attachment.bin>


More information about the llvm-commits mailing list