mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 02:25:38 +01:00
Core/Utils: Add aliasing constructors to Trinity::unique_weak_ptr allowing linked object lifetime (for example Aura and AuraEffect)
This commit is contained in:
@@ -179,6 +179,14 @@ public:
|
||||
unique_weak_ptr(unique_weak_ptr<T2>&& other) noexcept
|
||||
: _ptr(std::move(other)._ptr) { }
|
||||
|
||||
template <typename T2>
|
||||
unique_weak_ptr(unique_trackable_ptr<T2> const& aliased, T* aliasValue)
|
||||
: _ptr(std::shared_ptr<T>(aliased._ptr, aliasValue)) { }
|
||||
|
||||
template <typename T2>
|
||||
unique_weak_ptr(unique_trackable_ptr<T2>&& aliased, T* aliasValue)
|
||||
: _ptr(std::shared_ptr<T>(std::move(aliased)._ptr, aliasValue)) { }
|
||||
|
||||
unique_weak_ptr& operator=(unique_trackable_ptr<T> const& trackable)
|
||||
{
|
||||
_ptr = trackable._ptr;
|
||||
|
||||
Reference in New Issue
Block a user