jameskilton (owner)

Revisions

gist: 202324 Download_button fork
public
Public Clone URL: git://gist.github.com/202324.git
Embed All Files: show embed
C++ #
1
2
3
4
5
6
7
8
9
10
11
12
13
// 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!
}