Cromon

Untitled

Sep 4th, 2013
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.51 KB | None | 0 0
  1. template<typename A1>
  2. v8::Handle<v8::Value> __constructor1(v8::Arguments args) {
  3.     return createObject(args[0] as A1);
  4. }
  5.  
  6. template<typename A1, typename A2>
  7. v8::Handle<v8::Value> _constructor2(v8::Arguments args) {
  8.     return createObject(args[0] as A1, args[1] as A2);
  9. }
  10.  
  11. ...
  12.  
  13. template<typename A1>
  14. void def_constructor() {
  15.      v8::FunctionTemplate::New(&__constructor1<A1>);
  16. }
  17.  
  18. template<typename A1, typename A2>
  19. void def_constructor() {
  20.      v8::FunctionTemplate::New(&__constructor2<A1, A2>);
  21. }
Advertisement
Add Comment
Please, Sign In to add comment