Changeset 397

Show
Ignore:
Timestamp:
10/14/07 18:48:59 (1 year ago)
Author:
andrei
Message:

Changed case from IndexOf? to indexOf for consistency. Kept IndexOn? as an alias for backwards compatibility.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • candidate/phobos/std/typetuple.d

    r294 r397  
    6464 * { 
    6565 *    writefln("The index of long is ", 
    66  *          IndexOf!(long, TypeTuple!(int, long, double))); 
     66 *          indexOf!(long, TypeTuple!(int, long, double))); 
    6767 *    // prints: The index of long is 1 
    6868 * } 
    6969 * --- 
    7070 */ 
    71 template IndexOf(T, TList...) 
    72 { 
    73     static if (TList.length == 0) 
    74     const int IndexOf = -1; 
    75     else static if (is(T == TList[0])) 
    76     const int IndexOf = 0; 
    77     else 
    78     const int IndexOf = 
    79         (IndexOf!(T, TList[1 .. length]) == -1) 
     71template indexOf(T, TList...) 
     72{ 
     73    static if (TList.length == 0) 
     74    const int indexOf = -1; 
     75    else static if (is(T == TList[0])) 
     76    const int indexOf = 0; 
     77    else 
     78    const int indexOf = 
     79        (indexOf!(T, TList[1 .. length]) == -1) 
    8080            ? -1 
    81             : 1 + IndexOf!(T, TList[1 .. length]); 
    82 
     81            : 1 + indexOf!(T, TList[1 .. length]); 
     82
     83 
     84/// Kept for backwards compatibility 
     85alias indexOf IndexOf; 
    8386 
    8487/**