Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
emscripten-core
GitHub Repository: emscripten-core/emscripten
Path: blob/main/test/embind/test_optional_val_lib.cpp
6175 views
1
#include <emscripten/val.h>
2
#include <optional>
3
#include <string>
4
5
// This file deliberately does NOT include <emscripten/bind.h>
6
7
class MyType {
8
public:
9
void RunCallback(emscripten::val callback);
10
};
11
12
void MyType::RunCallback(emscripten::val cb) {
13
cb(std::make_optional(std::string{"Hey"}));
14
}
15
16