diff --git a/cheatsheet.md b/cheatsheet.md index 594b2f78..9ff4ad4b 100644 --- a/cheatsheet.md +++ b/cheatsheet.md @@ -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"); ``` +## 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>()); +``` + +This allows you to pass a ChaiScript function to a function requiring `std::vector` + ## Adding Objects ```