Changeset 1b65595


Ignore:
Timestamp:
Sep 14, 2022, 4:34:42 PM (19 months ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, master, pthread-emulation
Children:
a9762dc
Parents:
3acc863
Message:

Implemented move semantics for ValueGuardPtr?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Common/utility.h

    r3acc863 r1b65595  
    322322
    323323        ValueGuardPtr(T * inRef) : old( inRef ? *inRef : T() ), ref(inRef) {}
     324        ValueGuardPtr(const ValueGuardPtr& other) = delete;
     325        ValueGuardPtr(ValueGuardPtr&& other) : old(other.old), ref(other.ref) { other.ref = nullptr; }
    324326        ~ValueGuardPtr() { if( ref ) *ref = old; }
    325327};
Note: See TracChangeset for help on using the changeset viewer.