Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 3151

Show
Ignore:
Timestamp:
01/31/08 21:55:47 (10 months ago)
Author:
sean
Message:

Added comments explaining the reasoning behind the apparently inconsistent naming scheme in this module. This closes #601

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tango/core/Traits.d

    r3116 r3151  
    11/** 
    2  * The traits module defines tools useful for obtaining detailed type 
    3  * information at compile-time. 
     2 * The traits module defines tools useful for obtaining detailed compile-time 
     3 * information about a type.  Please note that the mixed naming scheme used in 
     4 * this module is intentional.  Templates which evaluate to a type follow the 
     5 * naming convention used for types, and templates which evaluate to a value 
     6 * follow the naming convention used for functions. 
    47 * 
    58 * Copyright: Copyright (C) 2005-2006 Sean Kelly.  All rights reserved. 
     
    1114 
    1215/** 
    13  * 
     16 * Evaluates to true if T is char, wchar, or dchar. 
    1417 */ 
    1518template isCharType( T ) 
     
    2225 
    2326/** 
    24  * 
     27 * Evaluates to true if T is a signed integer type. 
    2528 */ 
    2629template isSignedIntegerType( T ) 
     
    3538 
    3639/** 
    37  * 
     40 * Evaluates to true if T is an unsigned integer type. 
    3841 */ 
    3942template isUnsignedIntegerType( T ) 
     
    4851 
    4952/** 
    50  * 
     53 * Evaluates to true if T is a signed or unsigned integer type. 
    5154 */ 
    5255template isIntegerType( T ) 
     
    5861 
    5962/** 
    60  * 
     63 * Evaluates to true if T is a real floating-point type. 
    6164 */ 
    6265template isRealType( T ) 
     
    6972 
    7073/** 
    71  * 
     74 * Evaluates to true if T is a complex floating-point type. 
    7275 */ 
    7376template isComplexType( T ) 
     
    8083 
    8184/** 
    82  * 
     85 * Evaluates to true if T is an imaginary floating-point type. 
    8386 */ 
    8487template isImaginaryType( T ) 
     
    9194 
    9295/** 
    93  * 
     96 * Evaluates to true if T is any floating-point type: real, complex, or 
     97 * imaginary. 
    9498 */ 
    9599template isFloatingPointType( T ) 
     
    102106 
    103107/** 
    104  * 
     108 * Evaluates to true if T is a pointer type. 
    105109 */ 
    106110template isPointerType( T ) 
     
    111115 
    112116/** 
    113  * 
     117 * Evaluates to true if T is a a pointer, class, interface, or delegate. 
    114118 */ 
    115119template isReferenceType( T ) 
     
    124128 
    125129/** 
    126  * 
     130 * Evaulates to true if T is a dynamic array type. 
    127131 */ 
    128132template isDynamicArrayType( T ) 
     
    133137 
    134138/** 
    135  * 
     139 * Evaluates to true if T is a static array type. 
    136140 */ 
    137141template isStaticArrayType( T ) 
     
    142146 
    143147/** 
    144  * 
     148 * Evaluates to true if T is an associative array type. 
    145149 */ 
    146150private template isAssocArrayType( T ) 
     
    151155 
    152156/** 
    153  * 
     157 * Evaluates to true if T is a function, function pointer, delegate, or 
     158 * callable object. 
    154159 */ 
    155160template isCallableType( T ) 
     
    163168 
    164169/** 
    165  * 
     170 * Evaluates to the return type of Fn.  Fn is required to be a callable type. 
    166171 */ 
    167172template ReturnTypeOf( Fn ) 
     
    175180 
    176181/** 
    177  * 
     182 * Evaluates to the return type of fn.  fn is required to be callable. 
    178183 */ 
    179184template ReturnTypeOf( alias fn ) 
     
    187192 
    188193/** 
    189  * 
     194 * Evaluates to a tuple representing the parameters of Fn.  Fn is required to 
     195 * be a callable type. 
    190196 */ 
    191197template ParameterTupleOf( Fn ) 
     
    203209 
    204210/** 
    205  * 
     211 * Evaluates to a tuple representing the parameters of fn.  n is required to 
     212 * be callable. 
    206213 */ 
    207214template ParameterTupleOf( alias fn ) 
     
    215222 
    216223/** 
    217  * 
     224 * Evaluates to a tuple representing the ancestors of T.  T is required to be 
     225 * a class or interface type. 
    218226 */ 
    219227template BaseTypeTupleOf( T )