From 33aed7ee82844023346f8cb9c3108cb0d6c80369 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Sat, 29 Oct 2022 20:24:39 +0300 Subject: [PATCH] Tweak the constructors of Owned This makes it not break if an Owned is passed as the first argument. --- source/game/owned.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/game/owned.h b/source/game/owned.h index 620c6aa..b305ae2 100644 --- a/source/game/owned.h +++ b/source/game/owned.h @@ -21,6 +21,10 @@ public: Owned(Handle

, Args &&...); template + Owned(Owned

&p, Args &&... a): Owned(static_cast &>(p), std::forward(a)...) { } + + template + requires(!std::is_const_v

) Owned(P &parent, Args &&... args): Owned(Handle

::from_object(&parent), std::forward(args)...) { } Owned(Owned &&other): Handle(other) { other.ptr = nullptr; } -- 2.45.2