Files
cppdraft_translate/cppdraft/numeric/requirements.md
2025-10-25 03:02:53 +03:00

2.6 KiB

[numeric.requirements]

29 Numerics library [numerics]

29.2 Numeric type requirements [numeric.requirements]

1

#

Thecomplex andvalarray components are parameterized by the type of information they contain and manipulate.

A C++ program shall instantiate these components only with a numeric type.

A numeric type is a cv-unqualified object type T that meets theCpp17DefaultConstructible,Cpp17CopyConstructible,Cpp17CopyAssignable, andCpp17Destructible requirements ([utility.arg.requirements]).239

2

#

If any operation on T throws an exception the effects are undefined.

3

#

In addition, many member and related functions ofvalarray can be successfully instantiated and will exhibit well-defined behavior if and only ifT meets additional requirements specified for each such member or related function.

4

#

[Example 1:

It is valid to instantiatevalarray, butoperator>() will not be successfully instantiated forvalarray operands, sincecomplex does not have any ordering operators.

— end example]

239)239)

In other words, value types.

These include arithmetic types, pointers, the library classcomplex, and instantiations ofvalarray for value types.