Ada has nice feature of and then statement used in the if condition. This allows for checking if, e.g., the object is not null before accessing it like so:
if Object /= null and then Object.Value > 5 then
-- do something with the value
end if;
Is there a way to express a similar behaviour in C++ w/o using a nested if?
Aucun commentaire:
Enregistrer un commentaire