docs: Add push_back_ref() note

This commit is contained in:
Rob Loach 2019-01-31 09:16:59 -05:00
parent b0c1483f70
commit 62ccd6d2ff
No known key found for this signature in database
GPG Key ID: 627C60834A74A21A

View File

@ -389,11 +389,23 @@ switch (myvalue) {
## Built in Types ## Built in Types
There are a number of build-in types that are part of ChaiScript.
### Vectors and Maps
``` ```
var v = [1,2,3u,4ll,"16", `+`]; // creates vector of heterogenous values var v = [1,2,3u,4ll,"16", `+`]; // creates vector of heterogenous values
var m = ["a":1, "b":2]; // map of string:value pairs var m = ["a":1, "b":2]; // map of string:value pairs
// Add a value to the vector by value.
v.push_back(123);
// Add an object to the vector by reference.
v.push_back_ref(m);
``` ```
### Numbers
Floating point values default to `double` type and integers default to `int` type. All C++ suffixes Floating point values default to `double` type and integers default to `int` type. All C++ suffixes
such as `f`, `ll`, `u` as well as scientific notation are supported such as `f`, `ll`, `u` as well as scientific notation are supported