From: David Kastrup Date: Thu, 7 May 2015 19:21:54 +0000 (+0200) Subject: Define derived_unsmob function X-Git-Tag: release/2.19.21-1~51 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=428488bdc1a29c40b7b2326be3587270c49ff86a;p=lilypond.git Define derived_unsmob function This is a shortcut for dynamic_cast(T::unsmob (...)) in order to provide an unsmob function for derived classes. --- diff --git a/lily/include/smobs.hh b/lily/include/smobs.hh index 2787750ec5..138bf36346 100644 --- a/lily/include/smobs.hh +++ b/lily/include/smobs.hh @@ -234,6 +234,14 @@ public: } }; +// derived_unsmob includes a dynamic_cast: + +template +inline T *derived_unsmob (SCM arg) +{ + return dynamic_cast (T::unsmob (arg)); +} + // Simple smobs template class Simple_smob : public Smob_base {