forked from OSchip/llvm-project
OpaquePtr: Provide conversion-from-nullptr_t to make default construction simpler to read/write
llvm-svn: 257955
This commit is contained in:
parent
78f7907953
commit
62d4a253f7
|
@ -43,13 +43,13 @@ namespace clang {
|
|||
/// compatible with "Type" pointers for example.
|
||||
template <class PtrTy>
|
||||
class OpaquePtr {
|
||||
void *Ptr;
|
||||
void *Ptr = nullptr;
|
||||
explicit OpaquePtr(void *Ptr) : Ptr(Ptr) {}
|
||||
|
||||
typedef llvm::PointerLikeTypeTraits<PtrTy> Traits;
|
||||
|
||||
public:
|
||||
OpaquePtr() : Ptr(nullptr) {}
|
||||
OpaquePtr(std::nullptr_t = nullptr) {}
|
||||
|
||||
static OpaquePtr make(PtrTy P) { OpaquePtr OP; OP.set(P); return OP; }
|
||||
|
||||
|
|
Loading…
Reference in New Issue