valvector_ctor

View page source

The valvector Constructors

Creates a valvector (called x below).

Syntax

valvector x
valvector x*( *s )
valvector x*( *v )
valvector x*( { *s0 , s1 , … } )

Default

The default constructor (no argument) creates the valvector x with one element using the scalar_type default constructor.

Scalar

The scalar constructor (argument is s ) creates the valvector x with one element that is equal to scalar_type ( s ), where s has type scalar_type , int`, long int, double, long_double or size_t .

Vector

The vector constructor (argument is v) creates a copy of the valvector v .

List

In the standard initializer list constructor ( argument is { s0 , s1 , .. } ) s0 , s1 , have valvector scalar_type . This create a valvector with size equal the length of the list and j-th element equal to sj .

Example

The file valvector_ctor.cpp is an example and test of these constructors.