Convert x
to type U
, trapping on overflow in -Onone and -O
builds.
Typically used to do conversion to any contextually-deduced integer type:
Declaration
func
numericCast
<
T
,
U
where
T
:
_SignedInteger
,
U
:
UnsignedInteger
>
(
_
x
:
T
) -
>
U
Convert x
to type U
, trapping on overflow in -Onone and -O
builds.
Typically used to do conversion to any contextually-deduced integer type:
Declaration
func
numericCast
<
T
,
U
where
T
:
UnsignedInteger
,
U
:
_SignedInteger
>
(
_
x
:
T
) -
>
U
Convert x
to type U
, trapping on overflow in -Onone and -O
builds.
Typically used to do conversion to any contextually-deduced integer type:
Declaration
func
numericCast
<
T
,
U
where
T
:
UnsignedInteger
,
U
:
UnsignedInteger
>
(
_
x
:
T
) -
>
U
Convert
x
to typeU
, trapping on overflow in -Onone and -O builds.Typically used to do conversion to any contextually-deduced integer type:
Declaration
func
numericCast
<
T
,
U
where
T
:
_SignedInteger
,
U
:
_SignedInteger
>
(
_
x
:
T
) -
>
U