From 51355343f102b61622014f0cc93e97696144b99e Mon Sep 17 00:00:00 2001 From: Jason Turner Date: Sat, 11 Jul 2015 16:37:54 -0600 Subject: [PATCH] Add intro docs to user defined type conversions --- cheatsheet.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) 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 ```