From 2534fb9e1d3135a5919838e72a120254f9926f9b Mon Sep 17 00:00:00 2001 From: Georg Hopp Date: Thu, 31 Jul 2014 13:53:08 +0100 Subject: [PATCH] macro to cast one static instance to another class type. ATTENTION: no checks are done if the given class is really a parent of the instances class. --- include/tr/class.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/tr/class.h b/include/tr/class.h index ed0b075..add6419 100644 --- a/include/tr/class.h +++ b/include/tr/class.h @@ -138,6 +138,8 @@ { __VA_ARGS__ } \ } +#define TR_INSTANCE_CAST(class, name) ((class)&(_##name.data)) + /** * I initialize _ (the class's base or parent class) * with the identifier of that class.