Expand description
XTypes 1.3 §7.5.4.1.2 — TryConstruct-Apply (C4.7).
When a value does not fit the target member on decode or a setter
call (e.g. a string longer than the bound, a sequence over its
max length, an enum value outside the value range), the
try_construct strategy decides what happens:
Discard— discard the value, the member stays unset.UseDefault— ignore the value, setmember.default_value.Trim— truncate to the bound (strings + sequences); for other bound violations fall back to discard.
This logic is evaluated only when a bound violation actually
exists — un-bounded setters (member type without a bound limit)
stay unchanged.
Enums§
- TryConstruct
Outcome - Result of a try-construct evaluation.
Functions§
- apply_
try_ construct - Applies the
try_constructstrategy to a setter value. If there is no bound violation, the function returnsAccept(value)unchanged.