+ def visit_polymorphic(self, polymorphic):
+ print 'static void _write__%s(int selector, const %s & value) {' % (polymorphic.tag, polymorphic.expr)
+ print ' switch (selector) {'
+ for cases, type in polymorphic.iterswitch():
+ for case in cases:
+ print ' %s:' % case
+ dump_instance(type, 'static_cast<%s>(value)' % (type,))
+ print ' break;'
+ print ' }'
+ print '}'
+ print
+