Add intro docs to user defined type conversions

This commit is contained in:
Jason Turner 2015-07-11 16:37:54 -06:00
parent fe33a6aacb
commit 51355343f1

View File

@ -80,6 +80,18 @@ It's not strictly necessary to add types, but it helps with many things. Cloning
chai.add(chaiscript::user_type<MyClass>, "MyClass");
```
## Adding Type Conversions
User defined type conversions are possible, defined in either script or in C++.
A helper function exists for strongly typed and ChaiScript `Vector` function conversion definition:
```
chai.add(chaiscript::vector_conversion<std::vector<int>>());
```
This allows you to pass a ChaiScript function to a function requiring `std::vector<int>`
## Adding Objects
```