Syntax:
$remove_to(reference-expression);
This directive removes one or more last bound fields until the referenced field. reference-expression
is evaluated at run-time and must be a reference to a field in the current type.
All fields being removed must be visible and no hidden fields must be between them.
struct A
{
int type;
switch (type)
{
case 0:
B b;
break;
case 1:
C c;
break;
default:
$remove_to(ref(type));
D d;
}
};