Last active
November 30, 2020 14:34
-
-
Save carlopi/217bf960baa75c6a9d46b06e4eecbe40 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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