Changeset 379
- Timestamp:
- 07/05/08 17:03:27 (5 months ago)
- Files:
-
- trunk/tools/tools/base.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/tools/tools/base.d
r376 r379 911 911 912 912 struct Range { 913 static _Range!(T) opSlice(T, U)(T from, U to) { return _Range!(T)(from, to); } 913 enum Start { Incl, Excl } 914 enum End { Incl, Excl } 915 static _Range!(T) opSlice(T, U)(T from, U to, Start sm=Start.Incl, End em=End.Excl) { 916 if (sm != Start.Incl) from++; 917 if (em != End.Excl) to++; 918 return _Range!(T)(from, to); 919 } 914 920 static _Range!(T) opIndex(T)(T to) { return _Range!(T)(Init!(T), to); } 915 921 static void opIndexAssign(T, U)(lazy U whut, T to) { (opIndex(to))=whut; }
