mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-06 16:57:04 +08:00
docs: Add push_back_ref() note
This commit is contained in:
parent
b0c1483f70
commit
62ccd6d2ff
@ -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
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user