Update cheatsheet.md: Adding Lambda correction.

Currently, the example where a lambda function was added to chaiscript didn't work for me.
I use g++7, g++8,g++9 both with c++14 and c++17 mode.
It doesn't work either in clang++-7.

If the lambda is wrapped into a std::function<> it will work again!
This commit is contained in:
medithe 2019-04-25 23:18:51 +02:00 committed by GitHub
parent b0c1483f70
commit 57ebd9d403
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -66,7 +66,7 @@ chai.add(chaiscript::fun(static_cast<int(Derived::*)>(&Derived::data)), "data");
``` ```
chai.add( chai.add(
chaiscript::fun<std::string (bool)>( chaiscript::fun<std::function<std::string (bool)>>(
[](bool type) { [](bool type) {
if (type) { return "x"; } if (type) { return "x"; }
else { return "y"; } else { return "y"; }