From 41da3db06a32c7d98b9d7b3c9d017022e6326f03 Mon Sep 17 00:00:00 2001 From: SirNate0 Date: Tue, 21 Feb 2023 11:33:36 -0500 Subject: [PATCH] Fix cheatsheet.md typos Add missing parenthesis and quotes. --- cheatsheet.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cheatsheet.md b/cheatsheet.md index da5a1774..1daf298f 100644 --- a/cheatsheet.md +++ b/cheatsheet.md @@ -155,7 +155,7 @@ This allows you to pass a ChaiScript function to a function requiring `std::vect ``` chai.add(chaiscript::var(somevar), "somevar"); // copied in -chai.add(chaiscript::var(std::ref(somevar), "somevar"); // by reference, shared between C++ and chai +chai.add(chaiscript::var(std::ref(somevar)), "somevar"); // by reference, shared between C++ and chai auto shareddouble = std::make_shared(4.3); chai.add(chaiscript::var(shareddouble), "shareddouble"); // by shared_ptr, shared between c++ and chai chai.add(chaiscript::const_var(somevar), "somevar"); // copied in and made const @@ -301,7 +301,7 @@ p(5); // calls chaiscript's 'to_string' function, returning std::string("5") Note: backtick treats operators as normal functions ```cpp -auto p = chai.eval>(`+`); +auto p = chai.eval>("`+`"); p(5, 6); // calls chaiscript's '+' function, returning 11 ```