Created
March 22, 2017 22:29
-
-
Save jgehring/e483bf1ebb9c260e68d9b8f584c47a53 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
#include <memory> | |
#include <ponder/class.hpp> | |
#include <ponder/classbuilder.hpp> | |
class Test1 { | |
public: | |
Test1() { | |
value = 5; | |
} | |
int value; | |
}; | |
PONDER_TYPE(Test1); | |
class Test2 { | |
public: | |
Test2() {} // just for verifcation | |
void foo(std::shared_ptr<Test1> ptr) { | |
int a = ptr->value; | |
} | |
}; | |
PONDER_TYPE(Test2); | |
int main() { | |
// Test without ponder | |
std::shared_ptr<Test1> t1; | |
Test2 t2; | |
t2.foo(t1); | |
ponder::Class::declare<Test1>().constructor(); | |
ponder::Class::declare<Test2>() | |
.constructor() | |
// This does not work | |
.function("foo", &Test2::foo); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment