|
ChaiScript
|
#include <chaiscript_prelude_docs.hpp>
Public Member Functions | |
| Object | operator[] (int t_index) |
| returns the Object at the given index. Throws an exception if the index does not exist | |
| const Object | operator[] (int t_index) const |
| returns a const Object at the given index. Throws an exception if the index does not exist. | |
| Object | back () |
| returns the last item in the Vector | |
| void | clear () |
| Clears the Vector of all items. | |
| bool | empty () |
| Returns true if the Vector is contains 0 items. | |
| void | erase_at (int t_index) |
| Erases the element at the given index. | |
| Object | front () |
| Returns the first item in the Vector. | |
| void | insert_ref_at (int, Object) |
| Inserts a new item in the Vector at the given index. More... | |
| void | insert_at (int, Object) |
| Inserts a new item in the Vector at the given index. More... | |
| void | pop_back () |
| Removes the last item from the Vector. | |
| void | push_back_ref (Object) |
| Adds an item to the end of the Vector. More... | |
| void | push_back (Object) |
| Adds an item to the end of the Vector. More... | |
| Range | range () |
| Returns a Range object for the entire vector. | |
| Const_Range | range () const |
| Returns a Const_Range object for the entire vector. | |
| int | size () const |
| Returns the number of elements in the Vector. | |
A vector of Objects.
ChaiScript includes a shortcut for creating a Vector of Objects
Example:
Implemented with std::vector<chaiscript::Boxed_Value>
| void ChaiScript_Language::Vector::insert_at | ( | int | , |
| Object | |||
| ) |
Inserts a new item in the Vector at the given index.
The item is cloned on insert
| void ChaiScript_Language::Vector::insert_ref_at | ( | int | , |
| Object | |||
| ) |
Inserts a new item in the Vector at the given index.
The item is not cloned on insert
| void ChaiScript_Language::Vector::push_back | ( | Object | ) |
| void ChaiScript_Language::Vector::push_back_ref | ( | Object | ) |
1.8.13