[valarray.syn] (original) (raw)

29 Numerics library [numerics]

29.6 Numeric arrays [numarray]

29.6.1 Header synopsis [valarray.syn]

The header defines five class templates (valarray,slice_array,gslice_array,mask_array, andindirect_array), two classes (sliceandgslice), and a series of related function templates for representing and manipulating arrays of values.

Thevalarrayarray classes are defined to be free of certain forms of aliasing, thus allowing operations on these classes to be optimized.

Any function returning avalarray<T>is permitted to return an object of another type, provided all the const member functions ofvalarray<T>are also applicable to this type.

This return type shall not add more than two levels of template nesting over the most deeply nested argument type.248

Implementations introducing such replacement types shall provide additional functions and operators as follows:

In particular, an implementation shall allow avalarray<T>to be constructed from such replacement types and shall allow assignments and compound assignments of such types tovalarray<T>,slice_array<T>,gslice_array<T>,mask_array<T>andindirect_array<T>objects.

These library functions are permitted to throw abad_alloc exception if there are not sufficient resources available to carry out the operation.

Note that the exception is not mandated.