Changeset 122 for trunk/infrastructure/pyd/ctor_wrap.d
- Timestamp:
- 08/13/07 17:12:37 (5 years ago)
- Files:
-
- trunk/infrastructure/pyd/ctor_wrap.d (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/infrastructure/pyd/ctor_wrap.d
r121 r122 65 65 } 66 66 67 //import std.stdio; 67 68 // This template accepts a tuple of function pointer types, which each describe 68 69 // a ctor of T, and uses them to wrap a Python tp_init function. 69 template wrapped_ctors( /*T,*/C ...) {70 alias shim_class T;70 template wrapped_ctors(T, C ...) { 71 //alias shim_class T; 71 72 alias wrapped_class_object!(T) wrap_object; 72 73 … … 76 77 77 78 return exception_catcher({ 79 //writefln("in init_func: len=%s, T=%s, C.length=%s", len, typeid(T), C.length); 78 80 // Default ctor 79 81 static if (is(typeof(new T))) { … … 87 89 foreach(i, arg; c) { 88 90 alias ParameterTypeTuple!(typeof(arg)) Ctor; 91 //writefln(" init_func: i=%s, Ctor.length=%s, Ctor=%s", i, Ctor.length, typeid(typeof(arg))); 89 92 if (Ctor.length == len) { 90 93 auto fn = &call_ctor!(T, ParameterTypeTuple!(typeof(arg))); … … 94 97 } 95 98 alias typeof(fn) dg_t; 96 mixin applyPyTupleToDelegate!(dg_t);99 //mixin applyPyTupleToDelegate!(dg_t) A; 97 100 T t = applyPyTupleToDelegate(fn, args); 98 101 if (t is null) {
