mirror of
https://github.com/ChaiScript/ChaiScript.git
synced 2025-12-07 01:06:54 +08:00
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:
parent
b0c1483f70
commit
57ebd9d403
@ -66,7 +66,7 @@ chai.add(chaiscript::fun(static_cast<int(Derived::*)>(&Derived::data)), "data");
|
||||
|
||||
```
|
||||
chai.add(
|
||||
chaiscript::fun<std::string (bool)>(
|
||||
chaiscript::fun<std::function<std::string (bool)>>(
|
||||
[](bool type) {
|
||||
if (type) { return "x"; }
|
||||
else { return "y"; }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user