Mercurial > projects > ldc
comparison lphobos/std/traits.d @ 20:42bf2eb2973b trunk
[svn r24] * Added a simple std.traits by downs
author | lindquist |
---|---|
date | Thu, 04 Oct 2007 04:28:30 +0200 |
parents | |
children | 61615fa85940 |
comparison
equal
deleted
inserted
replaced
19:788401029ecf | 20:42bf2eb2973b |
---|---|
1 module std.traits; | |
2 struct TypeHolder(S, T...) { | |
3 S _ReturnType; | |
4 T _ParameterTypeTuple; | |
5 } | |
6 TypeHolder!(S, T) *IFTI_gen(S, T...)(S delegate(T) dg) { return null; } | |
7 TypeHolder!(S, T) *IFTI_gen(S, T...)(S function(T) dg) { return null; } | |
8 template ParameterTypeTuple(T) { | |
9 alias typeof(IFTI_gen(T.init)._ParameterTypeTuple) ParameterTypeTuple; | |
10 } | |
11 template ReturnType(T) { | |
12 alias typeof(IFTI_gen(T.init)._ReturnType) ReturnType; | |
13 } | |
14 template isArray(T) { const bool isArray=false; } | |
15 template isArray(T: T[]) { const bool isArray=true; } |