We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 376beab commit 61af061Copy full SHA for 61af061
src/util/std_expr.h
@@ -2111,6 +2111,15 @@ class typecast_exprt:public unary_exprt
2111
unary_exprt(ID_typecast, op, _type)
2112
{
2113
}
2114
+
2115
+ // returns a typecast if the type doesn't already match
2116
+ static exprt conditional_cast(const exprt &expr, const typet &type)
2117
+ {
2118
+ if(expr.type() == type)
2119
+ return expr;
2120
+ else
2121
+ return typecast_exprt(expr, type);
2122
+ }
2123
};
2124
2125
/*! \brief Cast a generic exprt to a \ref typecast_exprt
0 commit comments