diff --git a/source/numem/mem/ptr.d b/source/numem/mem/ptr.d index c8b9f16..b85ecbf 100644 --- a/source/numem/mem/ptr.d +++ b/source/numem/mem/ptr.d @@ -175,7 +175,9 @@ public: // atomically moves the reference from this unique_ptr to the other unique_ptr reference // after this is done, rc is set to null to make this unique_ptr invalid. atomicStore(this.rc, cast(refcountmg_t!(T)*)other.rc); - atomicStore(other.rc, null); + + // For LDC2 we'll need to do some more cursed pointer casts to be able to call clear on a const. + (cast(unique_ptr!(T)*)&other).clear(); } // Destructor @@ -219,16 +221,6 @@ public: return rc ? cast(VT)rc.ref_ : null; } - /** - Gets the value of the unique pointer - - Returns null if the item is no longer valid. - */ - @trusted - VT opCast() { - return rc ? cast(VT)rc.ref_ : null; - } - /** Makes a weak borrow of the unique pointer, weak borrows do not affect whether the object can be deleted by ref count reaching 0.