Skip to content

Instantly share code, notes, and snippets.

@carlopi
Last active November 30, 2020 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save carlopi/217bf960baa75c6a9d46b06e4eecbe40 to your computer and use it in GitHub Desktop.
Save carlopi/217bf960baa75c6a9d46b06e4eecbe40 to your computer and use it in GitHub Desktop.
class [[cheerp::jsexport]] CppClass
{
public:
CppClass(int n, bool flag)
{ /*initialization*/ }
void processNum(int k)
{/* ... */}
bool isValid()
{/* ... */ return true;}
static void staticMethod()
{client::console.log("it works!");}
private:
void somePrivateMethod()
{/* ... */}
//some fields
};
var instance = new CppClass(42);
instance.processNum(100);
if (instance.isValid())
instance.processNum(1000);
CppClass.staticMethod();
//it works!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment