mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-04 18:09:20 +00:00
allow OwningPtr to be copy constructed if null, which is required to
make them be a valuetype in a DenseMap. llvm-svn: 148688
This commit is contained in:
parent
606872615f
commit
0a21f75290
@ -25,12 +25,15 @@ namespace llvm {
|
||||
/// pointee object can be taken away from OwningPtr by using the take method.
|
||||
template<class T>
|
||||
class OwningPtr {
|
||||
OwningPtr(OwningPtr const &); // DO NOT IMPLEMENT
|
||||
OwningPtr &operator=(OwningPtr const &); // DO NOT IMPLEMENT
|
||||
OwningPtr &operator=(const OwningPtr &); // DO NOT IMPLEMENT
|
||||
T *Ptr;
|
||||
public:
|
||||
explicit OwningPtr(T *P = 0) : Ptr(P) {}
|
||||
|
||||
OwningPtr(const OwningPtr &RHS) : Ptr(0) {
|
||||
assert(RHS.Ptr == 0 && "Only null OwningPtr's are copyable!");
|
||||
}
|
||||
|
||||
~OwningPtr() {
|
||||
delete Ptr;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user