Skip to content

Instantly share code, notes, and snippets.

@AustinBrunkhorst
Created March 25, 2018 00:03
Show Gist options
  • Save AustinBrunkhorst/ee94408f4ab0368777a5e868627f13c8 to your computer and use it in GitHub Desktop.
Save AustinBrunkhorst/ee94408f4ab0368777a5e868627f13c8 to your computer and use it in GitHub Desktop.
C++ Reflection | Lambda Wrapper
class DemoClass
{
public:
int someMethod(int a)
{
return a;
}
};
auto someMethodWrapper = [](Variant &obj, ArgumentList &args)
{
auto &instance = obj.GetValue( );
return Variant {
instance.someMethod(
args[ 0 ].GetValue( )
)
};
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment