X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fgame%2Fhandle.h;h=b08bcf8e4f903028894702e8085df47174ce640f;hb=c3ac50ad3e79b26d1d99bd222a7e43adb86c2c1e;hp=2e544c7238e75ca7d5418c9f5c7a05c65e61081e;hpb=5ef7c7a9e1e6681ce43fae217e0c3a1b846e6874;p=libs%2Fgame.git diff --git a/source/game/handle.h b/source/game/handle.h index 2e544c7..b08bcf8 100644 --- a/source/game/handle.h +++ b/source/game/handle.h @@ -39,6 +39,13 @@ public: bool operator==(const Handle &other) const = default; }; +template + requires std::is_base_of_v +Handle dynamic_handle_cast(Handle h) +{ + return Handle::from_object(dynamic_cast(h.get())); +} + } // namespace Msp::Game #endif