fn: std::vector<double>

[contents]

Contents

Syntax

The syntax for std::vector<double> definitions is:

f++:  
std::vector<double> definitions
std::vector<double>(definitions)
:=(std::vector<double>, definitions)
n++:  
@std::vector<double> definitions
@std::vector<double>(definitions)
@:=(std::vector<double>, definitions)

Note: If you are using the first syntax for variable definitions and want to have more code and/or text following on the same line then simply end the definition with ';'.

Description

The std::vector<double> type is used for standard C++ vectors of doubles.

Note: If you need to define thousands of variables then := is faster, plus it has useful error messages for unrecognised types.

Member functions

The following member functions are available for std::vector<double> variables:

option description
at(index) get element at specified index
erase(index) erase element at specified index
erase(index, index) erase elements between specified indices
pop_back() erase last element
push_back(params) push elements on to back
set(index, param) set element at specified index
size() returns current size
option description

Options

The following options are available for std::vector<double> definitions:

option description
const definition of a constant
layer="x" define variable at layer x
!mf do not add member functions for variables
private definition of a private
scope+="x" add x to scopes variable can be accessed from
option description

f++ example

Examples of std::vector<double> being defined with f++:

std::vector<double> v
v.push_back(2.718, 3.142)
console(v.at(1))

std::vector<double> v(20), v2(30)
v2.set(20, 3.26)
console(v2.at(20))

std::vector<string> v(2000, 5.52)
console(v.at(20))

n++ example

Examples of std::vector<double> being defined with n++:

@std::vector<string> v
@v.push_back(2.718, 3.142)
@console(v.at(1))

@std::vector<string> v(20), v2(30)
@v2.set(20, 3.26)
@console(v2.at(20))

@std::vector<string> v(2000, 5.52)
@console(v.at(20))