Merge pull request #474 from ChaiScript/push_back_ref

docs: Add push_back_ref() note
This commit is contained in:
Rob Loach 2019-04-25 18:26:39 -04:00 committed by GitHub
commit 6ce716f5f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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