Skip to content

Instantly share code, notes, and snippets.

@jasonroelofs
Created October 5, 2009 18:28
Show Gist options
  • Save jasonroelofs/202324 to your computer and use it in GitHub Desktop.
Save jasonroelofs/202324 to your computer and use it in GitHub Desktop.
// Wrapping this method:
int global_do(int x, int y = 3, int z = 10) {
return x * y * z;
}
// Happens like this:
{
typedef int ( *global_do_func_type )( int x, int y, int z );
Rice::define_global_function("global_do",
global_do_func_type( &default_args::global_do ),
(Rice::Arg("x"), Rice::Arg("y") = 3, Rice::Arg("z") = 10)); // Comma operator woot!
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment