search for: transient_unique_ptr

Displaying 1 result from an estimated 1 matches for "transient_unique_ptr".

2017 Oct 11
3
TargetRegistry and MC object ownership.
...nt and store the result there (thanks to Dave Blaikie for this suggestion). Passing the unique_ptrs by pointer means we don't need a definition for T. Usage looks like: std::unique_ptr<MCAsmBackend> MAB; Target.createMCAsmBackend(&MAB, TheTriple, CPU, Options); (3) Introduce a 'transient_unique_ptr<T>' type that never calls T's destructor, and whose purpose is to pass off ownership to a real unique_ptr: template <typename T> class transient_unique_ptr { public: transient_unique_ptr(std::unique_ptr<T> InVal) : Val(InVal.release()) {} transient_unique_ptr(transien...