• Map Information

D

By nicholasr

D Standard and Core Libraries, 2.052, work in progress

Added: March 14, 2011 18:29:19

483 views | 0 download

  • Comments (0)
  • Outline

D

D
1 Core
1.1 core.thread

The thread module provides support for thread creation and management. Authors: Sean Kelly, Walter Bright

1.1.1 Classes
1.1.1.1 Thread

This class encapsulates all threading functionality for the D programming language. As thread manipulation is a required facility for garbage collection, all user threads should derive from this class, and instances of this class should never be explicitly deleted. A new thread may be created using either derivation or composition, as in the following example.

1.1.1.1.1 Attributes
1.1.1.1.1.1 PRIORITY_MIN int __gshared const

The minimum scheduling priority that may be set for a thread. On systems where multiple scheduling policies are defined, this value represents the minimum valid priority for the scheduling policy of the process.

1.1.1.1.1.2 PRIORITY_MAX int __gshared const

The maximum scheduling priority that may be set for a thread. On systems where multiple scheduling policies are defined, this value represents the minimum valid priority for the scheduling policy of the process.

1.1.1.1.2 Functions
1.1.1.1.2.1 this ( void delegate() dg, size_t sz = 0 )

Initializes a thread object which is associated with a dynamic D function. Parameters: void delegate() dg The thread function. size_t sz The stack size for this thread. In: dg must not be null.

1.1.1.1.2.2 this ( void function() fn, size_t sz = 0 )

Initializes a thread object which is associated with a static D function. Parameters: void function() fn The thread function. size_t sz The stack size for this thread. In: fn must not be null.

1.1.1.1.2.3 getAll static Thread[] ()

Provides a list of all threads currently being tracked by the system. Returns: An array containing references to all threads currently being tracked by the system. The result of deleting any contained objects is undefined.

1.1.1.1.2.4 getThis static Thread ()

Provides a reference to the calling thread. Returns: The thread object representing the calling thread. The result of deleting this object is undefined.

1.1.1.1.2.5 isDaemon final bool ()

Gets the daemon status for this thread. While the runtime will wait for all normal threads to complete before tearing down the process, daemon threads are effectively ignored and thus will not prevent the process from terminating. In effect, daemon threads will be terminated automatically by the OS when the process exits. Returns: true if this is a daemon thread.

1.1.1.1.2.6 isDaemon final void ( bool val )

Sets the daemon status for this thread. While the runtime will wait for all normal threads to complete before tearing down the process, daemon threads are effectively ignored and thus will not prevent the process from terminating. In effect, daemon threads will be terminated automatically by the OS when the process exits. Parameters: bool val The new daemon status for this thread.

1.1.1.1.2.7 isRunning final bool ()

Tests whether this thread is running. Returns: true if the thread is running, false if not.

1.1.1.1.2.8 join final Throwable ( bool rethrow = true )

Waits for this thread to complete. If the thread terminated as the result of an unhandled exception, this exception will be rethrown. Parameters: bool rethrow Rethrow any unhandled exception which may have caused this thread to terminate. Throws: ThreadException if the operation fails. Any exception not handled by the joined thread. Returns: Any exception not handled by this thread if rethrow = false, null otherwise.

1.1.1.1.2.9 name final string ()

Gets the user-readable label for this thread. Returns: The name of this thread.

1.1.1.1.2.10 name final void ( string val )

Sets the user-readable label for this thread. Parameters: string val The new name of this thread.

1.1.1.1.2.11 opApply static int ( scope int delegate( ref Thread ) dg )

Operates on all threads currently being tracked by the system. The result of deleting any Thread object is undefined. Parameters: int delegate(ref Thread) dg The supplied code as a delegate. Returns: Zero if all elemented are visited, nonzero if not.

1.1.1.1.2.12 priority final int ()

Gets the scheduling priority for the associated thread. Returns: The scheduling priority of this thread.

1.1.1.1.2.13 priority final void ( int val )

Sets the scheduling priority for the associated thread. Parameters: int val The new scheduling priority of this thread.

1.1.1.1.2.14 sleep static void ( Duration val )

Suspends the calling thread for at least the supplied period. This may result in multiple OS calls if period is greater than the maximum sleep duration supported by the operating system. Parameters: Duration val The minimum duration the calling thread should be suspended. In: period must be non-negative. Example: Thread.sleep( dur!("msecs")( 50 ) ); // sleep for 50 milliseconds Thread.sleep( dur!("seconds")( 5 ) ); // sleep for 5 seconds

1.1.1.1.2.15 sleep static void ( long period )

Suspends the calling thread for at least the supplied period. This may result in multiple OS calls if period is greater than the maximum sleep duration supported by the operating system. Parameters: long period The minimum duration the calling thread should be suspended, in 100 nanosecond intervals. In: period must be non-negative. Example: Thread.sleep( 500_000 ); // sleep for 50 milliseconds Thread.sleep( 50_000_000 ); // sleep for 5 seconds

1.1.1.1.2.16 start final void ()

Starts the thread and invokes the function or delegate passed upon construction. In: This routine may only be called once per thread instance. Throws: ThreadException if the thread fails to start.

1.1.1.1.2.17 yield static void ()

Forces a context switch to occur away from the calling thread.

1.1.1.2 ThreadGroup

This class is intended to simplify certain common programming techniques.

1.1.1.2.1 Functions
1.1.1.2.1.1 add final void ( Thread t )

Add t to the list of tracked threads if it is not already being tracked. Parameters: Thread t The thread to add. In: t must not be null.

1.1.1.2.1.2 create final Thread ( void delegate() dg )

Creates and starts a new Thread object that executes dg and adds it to the list of tracked threads. Parameters: void delegate() dg The thread function. Returns: A reference to the newly created thread.

1.1.1.2.1.3 create final Thread ( void function() fn )

Creates and starts a new Thread object that executes fn and adds it to the list of tracked threads. Parameters: void function() fn The thread function. Returns: A reference to the newly created thread.

1.1.1.2.1.4 joinAll final void ( bool rethrow = true )

Iteratively joins all tracked threads. This function will block add, remove, and opApply until it completes. Parameters: bool rethrow Rethrow any unhandled exception which may have caused the current thread to terminate. Throws: Any exception not handled by the joined threads.

1.1.1.2.1.5 opApply final int ( scope int delegate( ref Thread ) dg )

Operates on all threads currently tracked by this object.

1.1.1.2.1.6 remove final void ( Thread t )

Removes t from the list of tracked threads. No operation will be performed if t is not currently being tracked by this object. Parameters: Thread t The thread to remove. In: t must not be null.

1.1.1.3 Fiber

This class provides a cooperative concurrency mechanism integrated with the threading and garbage collection functionality. Calling a fiber may be considered a blocking operation that returns when the fiber yields (via Fiber.yield()). Execution occurs within the context of the calling thread so synchronization is not necessary to guarantee memory visibility so long as the same thread calls the fiber each time. Please note that there is no requirement that a fiber be bound to one specific thread. Rather, fibers may be freely passed between threads so long as they are not currently executing. Like threads, a new fiber thread may be created using either derivation or composition, as in the following example. Authors: Based on a design by Mikola Lysenko.

1.1.1.3.1 Attributes
1.1.1.3.1.1 State enum

enum State { HOLD, EXEC, TERM } A fiber may occupy one of three states: HOLD, EXEC, and TERM. The HOLD state applies to any fiber that is suspended and ready to be called. The EXEC state will be set for any fiber that is currently executing. And the TERM state is set when a fiber terminates. Once a fiber terminates, it must be reset before it may be called again.

1.1.1.3.2 Functions
1.1.1.3.2.1 this ( void delegate() dg, size_t sz = PAGESIZE )

Initializes a fiber object which is associated with a dynamic D function. Parameters: void delegate() dg The thread function. size_t sz The stack size for this fiber. In: dg must not be null.

1.1.1.3.2.2 this ( void function() fn, size_t sz = PAGESIZE )

Initializes a fiber object which is associated with a static D function. Parameters: void function() fn The thread function. size_t sz The stack size for this fiber. In: fn must not be null.

1.1.1.3.2.3 this shared static ()
1.1.1.3.2.4 call final Object ( bool rethrow = true )

Transfers execution to this fiber object. The calling context will be suspended until the fiber calls Fiber.yield() or until it terminates via an unhandled exception. Parameters: bool rethrow Rethrow any unhandled exception which may have caused this fiber to terminate. In: This fiber must be in state HOLD. Throws: Any exception not handled by the joined thread. Returns: Any exception not handled by this fiber if rethrow = false, null otherwise.

1.1.1.3.2.5 getThis static Fiber ()

Provides a reference to the calling fiber or null if no fiber is currently active. Returns: The fiber object representing the calling fiber or null if no fiber is currently active. The result of deleting this object is undefined.

1.1.1.3.2.6 reset final void ()

Resets this fiber so that it may be re-used. This routine may only be called for fibers that have terminated, as doing otherwise could result in scope-dependent functionality that is not executed. Stack-based classes, for example, may not be cleaned up properly if a fiber is reset before it has terminated. In: This fiber must be in state TERM.

1.1.1.3.2.7 state final @property State () const

Gets the current state of this fiber. Returns: The state of this fiber as an enumerated value.

1.1.1.3.2.8 yield static void ()

Forces a context switch to occur away from the calling fiber.

1.1.1.3.2.9 yieldAndThrow static void ( Throwable t )

Forces a context switch to occur away from the calling fiber and then throws obj in the calling fiber. Parameters: Throwable t The object to throw. In: t must not be null.

1.1.1.4 ThreadException : Exception
1.1.1.5 FiberException : Exception
1.1.2 Functions
1.1.2.1 this shared static ()
1.1.2.2 thread_attachThis Thread ()
1.1.2.3 thread_detachByAddr void ( Thread.ThreadAddr addr )
1.1.2.4 thread_detachThis void ()
1.1.2.5 thread_findByAddr static Thread ( Thread.ThreadAddr addr )
1.1.2.6 thread_init void ()
1.1.2.7 thread_isMainThread bool ()
1.1.2.8 thread_joinAll void ()
1.1.2.9 thread_needLock bool () nothrow
1.1.2.10 thread_resumeAll void ()
1.1.2.11 thread_scanAll void ( scanAllThreadsFn scan, void* curStackTop = null )
1.1.2.12 thread_suspendAll void ()
2 Phobos

3/10/2011 DMD2.052 std.datetime updated std.date deprecated 2/1/2011 DMD2.051 std.* core*

2.1 std.algorithm

Implements algorithms oriented mainly towards processing of sequences. Some functions are semantic equivalents or supersets of those found in the header in Alexander Stepanov's Standard Template Library for C++. Note: Many functions in this module are parameterized with a function or a predicate . The predicate may be passed either as a function name, a delegate name, a functor name, or a compile-time string. The string may consist of any legal D expression that uses the symbol a (for unary functions) or the symbols a and b (for binary functions). These names will NOT interfere with other homonym symbols in user code because they are evaluated in a different context. The default for all binary comparison predicates is "a == b" for unordered operations and "a < b" for ordered operations. Authors: Andrei Alexandrescu

2.1.1 Structs
2.1.1.1 BoyerMooreFinder

struct BoyerMooreFinder(alias pred, Range)

2.1.1.1.1 Attributes
2.1.1.1.1.1 needle Range
2.1.1.1.1.2 occ sizediff_t[ElementType!(Range)]
2.1.1.1.1.3 skip[] size_t
2.1.1.1.2 Functions
2.1.1.1.2.1 this (Range needle)
2.1.1.1.2.2 beFound Range (Range haystack)
2.1.1.1.2.3 length size_t ()
2.1.1.2 Filter

struct Filter(alias pred, Range) if (isInputRange!(Unqual!Range))

2.1.1.2.1 Attributes
2.1.1.2.1.1 R alias Unqual!Range
2.1.1.2.1.2 _input R
2.1.1.2.2 Functions
2.1.1.2.2.1 this (R r)
2.1.1.2.2.2 empty bool ()
2.1.1.2.2.3 front ElementType!(Range) ()
2.1.1.2.2.4 opSlice Filter ()
2.1.1.2.2.5 popFront void ()
2.1.1.2.2.6 save typeof(this) ()

static if(isForwardRange!R)

2.1.1.3 Group

struct Group(alias pred, R) if (isInputRange!R)

2.1.1.3.1 Functions
2.1.1.3.1.1 this (R input)
2.1.1.3.1.2 empty bool ()
2.1.1.3.1.3 front Tuple!(ElementType!R, uint) ()
2.1.1.3.1.4 popFront void ()
2.1.1.3.1.5 save typeof(this) ()
2.1.1.4 Levenshtein

struct Levenshtein(Range, alias equals, CostType = size_t)

2.1.1.4.1 Functions
2.1.1.4.1.1 deletionIncrement void (CostType n)
2.1.1.4.1.2 distance CostType (Range s, Range t)
2.1.1.4.1.3 insertionIncrement void (CostType n)
2.1.1.4.1.4 path EditOp[] ()
2.1.1.4.1.5 path EditOp[] (Range s, Range t)
2.1.1.5 Map

struct Map(alias fun, Range) if (isInputRange!(Unqual!Range))

2.1.1.5.1 Attributes
2.1.1.5.1.1 _cache Unqual!ElementType
2.1.1.5.1.2 _fun alias fun
2.1.1.5.1.3 _input R
2.1.1.5.1.4 ElementType alias typeof({ return _fun(.ElementType!(R).init) }())
2.1.1.5.1.5 R alias Unqual!Range
2.1.1.5.2 Functions
2.1.1.5.2.1 this (R input)
2.1.1.5.2.2 back ElementType ()

static if (isBidirectionalRange!(R))

2.1.1.5.2.3 empty bool ()
2.1.1.5.2.4 front ElementType ()
2.1.1.5.2.5 length size_t ()

static if (is(typeof(_input.length) : size_t) || is(typeof(_input.length()) : size_t))

2.1.1.5.2.6 opIndex ElementType (size_t index)

static if (isRandomAccessRange!R)

2.1.1.5.2.7 opSlice typeof(this) (size_t lowerBound, size_t upperBound)

static if (hasSlicing!(R))

2.1.1.5.2.8 popBack void ()

static if (isBidirectionalRange!(R))

2.1.1.5.2.9 popFront void ()
2.1.1.5.2.10 save Map ()

static if (isForwardRange!R)

2.1.1.6 NWayUnion

struct NWayUnion(alias less, RangeOfRanges)

2.1.1.6.1 Attributes
2.1.1.6.1.1 _heap BinaryHeap!(RangeOfRanges, compFront)
2.1.1.6.2 Functions
2.1.1.6.2.1 this (RangeOfRanges ror)
2.1.1.6.2.2 compFront bool (.ElementType!RangeOfRanges a, .ElementType!RangeOfRanges b)
2.1.1.6.2.3 empty bool ()
2.1.1.6.2.4 front ElementType ()
2.1.1.6.2.5 popFront void ()
2.1.1.7 SetUnion

struct SetUnion(alias less = "a < b", Rs...) if (allSatisfy!(isInputRange, Rs))

2.1.1.7.1 Attributes
2.1.1.7.1.1 ElementType alias CommonType!(staticMap!(.ElementType, Rs))
2.1.1.7.2 Functions
2.1.1.7.2.1 this (Rs rs)
2.1.1.7.2.2 empty bool ()
2.1.1.7.2.3 front ElementType ()
2.1.1.7.2.4 length size_t ()

static if (allSatisfy!(hasLength, Rs))

2.1.1.7.2.5 popFront void ()
2.1.1.7.2.6 save typeof(this) ()

static if(allSatisfy!(isForwardRange, Rs))

2.1.1.8 SetIntersection

struct SetIntersection(alias less = "a < b", Rs...) if (allSatisfy!(isInputRange, Rs))

2.1.1.8.1 Functions
2.1.1.8.1.1 this (Rs input)
2.1.1.8.1.2 empty bool ()
2.1.1.8.1.3 front ElementType ()
2.1.1.8.1.4 popFront void ()
2.1.1.8.1.5 save typeof(this) ()

static if(allSatisfy!(isForwardRange, Rs))

2.1.1.9 SetDifference

struct SetDifference(alias less = "a < b", R1, R2) if (isInputRange!(R1) && isInputRange!(R2))

2.1.1.9.1 Functions
2.1.1.9.1.1 this (R1 r1, R2 r2)
2.1.1.9.1.2 empty bool ()
2.1.1.9.1.3 front ElementType!(R1) ()
2.1.1.9.1.4 popFront void ()
2.1.1.9.1.5 save typeof(this) ()

static if(isForwardRange!R1 && isForwardRange!R2)

2.1.1.10 SetSymmetricDifference

struct SetSymmetricDifference(alias less = "a < b", R1, R2) if (isInputRange!(R1) && isInputRange!(R2))

2.1.1.10.1 Functions
2.1.1.10.1.1 this (R1 r1, R2 r2)
2.1.1.10.1.2 empty bool ()
2.1.1.10.1.3 front ElementType!(R1) ()
2.1.1.10.1.4 opSlice auto ()
2.1.1.10.1.5 popFront void ()
2.1.1.10.1.6 save typeof(this) ()

static if(isForwardRange!R1 && isForwardRange!R2)

2.1.1.11 Splitter

struct Splitter(Range, Separator) if (is(typeof(ElementType!Range.init == Separator.init)) && hasSlicing!Range) Splits a range using an element as a separator. This can be used with any range type, but is most popular with string types. Two adjacent separators are considered to surround an empty element in the split range. If the empty range is given, the result is a range with one empty element. If a range with one separator is given, the result is a range with two empty elements.

2.1.1.11.1 Functions
2.1.1.11.1.1 this (Range input, Separator separator)
2.1.1.11.1.2 back Range ()

static if(isBidirectionalRange!Range)

2.1.1.11.1.3 empty bool ()
2.1.1.11.1.4 front Range ()
2.1.1.11.1.5 popBack void ()

static if(isBidirectionalRange!Range)

2.1.1.11.1.6 popFront void ()
2.1.1.11.1.7 save typeof(this) ()

static if(isForwardRange!Range)

2.1.1.12 Splitter

struct Splitter(Range, Separator) if (is(typeof(Range.init.front == Separator.init.front))) Splits a range using another range as a separator. This can be used with any range type, but is most popular with string types.

2.1.1.12.1 Functions
2.1.1.12.1.1 this (Range input, Separator separator)
2.1.1.12.1.2 back Range ()

static if(isBidirectionalRange!Range)

2.1.1.12.1.3 empty bool ()
2.1.1.12.1.4 front Range ()
2.1.1.12.1.5 popBack void ()

static if(isBidirectionalRange!Range)

2.1.1.12.1.6 popFront void ()
2.1.1.12.1.7 save typeof(this) ()

static if(isForwardRange!Range)

2.1.1.13 Splitter

struct Splitter(alias isTerminator, Range, Slice = Select!(is(typeof(Range.init[0 .. 1])), Range, ElementType!(Range)[]))

2.1.1.13.1 Functions
2.1.1.13.1.1 this (Range input)
2.1.1.13.1.2 empty bool ()
2.1.1.13.1.3 front Range ()
2.1.1.13.1.4 popFront void ()
2.1.1.13.1.5 save typeof(this) ()

static if(isForwardRange!Range)

2.1.1.14 Uniq

struct Uniq(alias pred, R)

2.1.1.14.1 Attributes
2.1.1.14.1.1 _input R
2.1.1.14.2 Functions
2.1.1.14.2.1 this (R input)
2.1.1.14.2.2 back ElementType!(R) ()

static if (isBidirectionalRange!R)

2.1.1.14.2.3 empty bool ()
2.1.1.14.2.4 front ElementType!(R) ()
2.1.1.14.2.5 opSlice Uniq ()
2.1.1.14.2.6 popBack void ()

static if (isBidirectionalRange!R)

2.1.1.14.2.7 popFront void ()
2.1.1.14.2.8 save typeof(this) ()

static if (isForwardRange!R)

2.1.1.15 Until

struct Until(alias pred, Range, Sentinel) if (isInputRange!Range)

2.1.1.15.1 Attributes
2.1.1.15.1.1 _openRight OpenRight
2.1.1.15.1.2 _done bool
2.1.1.15.2 Functions
2.1.1.15.2.1 this (Range input, OpenRight openRight = OpenRight.yes)
2.1.1.15.2.2 this (Range input, Sentinel sentinel, OpenRight openRight = OpenRight.yes)

static if (!is(Sentinel == void))

2.1.1.15.2.3 empty bool ()
2.1.1.15.2.4 front ElementType!Range ()
2.1.1.15.2.5 popFront void ()
2.1.1.15.2.6 predSatisfied bool ()
2.1.2 Attributes
2.1.2.1 EditOp enum

enum EditOp : char { /** Current items are equal; no editing is necessary. */ none = 'n', /** Substitute current item in target with current item in source. */ substitute = 's', /** Insert current item from the source into the target. */ insert = 'i', /** Remove current item from the target. */ remove = 'r' }

2.1.2.2 OpenRight enum

enum OpenRight { no, /// Interval is closed to the right (last element included) yes /// Interval is open to the right (last element is not included) }

2.1.2.3 SortOutput enum

enum SortOutput { no, /// Don't sort output yes, /// Sort output }

2.1.2.4 SwapStrategy enum

enum SwapStrategy { /** Allows freely swapping of elements as long as the output satisfies the algorithm's requirements. */ unstable, /** In algorithms partitioning ranges in two, preserve relative ordering of elements only to the left of the partition point. */ semistable, /** Preserve the relative ordering of elements to the largest extent allowed by the algorithm's requirements. */ stable, }

2.1.3 Functions
2.1.3.1 balancedParens bool (Range, E)(Range r, E lPar, E rPar, size_t maxNestingLevel = size_t.max)
2.1.3.2 boyerMooreFinder BoyerMooreFinder!(binaryFun!(pred), Range) (alias pred = "a == b", Range)(Range needle)
2.1.3.3 bringToFront size_t (Range1, Range2)(Range1 front, Range2 back)
2.1.3.4 canFind bool (alias pred = "a == b", Range, V)(Range range, V value)
2.1.3.5 canFind bool (alias pred, Range)(Range range)
2.1.3.6 canFindSorted bool (alias pred = "a < b", Range, V)(Range range, V value)
2.1.3.7 completeSort void (alias less = "a < b", SwapStrategy ss = SwapStrategy.unstable, Range1, Range2)(SortedRange!(Range1, less) lhs, Range2 rhs)
2.1.3.8 copy Range2 (Range1, Range2)(Range1 source, Range2 target)
2.1.3.9 count size_t (alias pred = "a == b", Range, E)(Range r, E value)
2.1.3.10 count size_t (alias pred = "true", Range)(Range r)

if (isInputRange!(Range))

2.1.3.11 endsWith uint (alias pred = "a == b", Range, Elements...)(Range doesThisEnd, Elements withOneOfThese)
2.1.3.12 endsWith uint (alias pred = "a == b", Range, Ranges...)(Range doesThisEnd, Ranges withOneOfThese)
2.1.3.13 equal bool (alias pred = "a == b", Range1, Range2)(Range1 r1, Range2 r2)
2.1.3.14 equalRange Range (alias pred = "a < b", Range, V)(Range range, V value)
2.1.3.15 fill void (Range, Value)(Range range, Value filler)
2.1.3.16 fill void (Range1, Range2)(Range1 range, Range2 filler)
2.1.3.17 find R (alias pred = "a == b", R, E)(R haystack, E needle)
2.1.3.18 find R1 (alias pred = "a == b", R1, R2)(R1 haystack, R2 needle)
2.1.3.19 find R1 (alias pred = "a == b", R1, R2)(R1 haystack, R2 needle)
2.1.3.20 find R1 (alias pred = "a == b", R1, R2)(R1 haystack, R2 needle)
2.1.3.21 find Range (alias pred, Range)(Range haystack)

if (isInputRange!(Range))

2.1.3.22 find Range1 (Range1, alias pred, Range2)(Range1 haystack, BoyerMooreFinder!(pred, Range2) needle)
2.1.3.23 find Tuple!(Range, size_t) (alias pred = "a == b", Range, Ranges...)(Range haystack, Ranges needles)
2.1.3.24 findAdjacent Range (alias pred = "a == b", Range)(Range r)
2.1.3.25 findAmong Range1 (alias pred = "a == b", Range1, Range2)(Range1 seq, Range2 choices)
2.1.3.26 getPivot size_t (alias less, Range)(Range r)
2.1.3.27 group Group!(pred, Range) (alias pred = "a == b", Range)(Range r)
2.1.3.28 indexOf sizediff_t (alias pred = "a == b", R1, R2)(R1 haystack, R2 needle)
2.1.3.29 initializeAll void (Range)(Range range)
2.1.3.30 isPartitioned bool (alias pred, Range)(Range r)
2.1.3.31 isSorted bool (alias less = "a < b", Range)(Range r)

if (isForwardRange!(Range))

2.1.3.32 joiner auto (Range, Separator)(Range r, Separator sep)
2.1.3.33 largestPartialIntersection void (alias less = "a < b", RangeOfRanges, Range)(RangeOfRanges ror, Range tgt, SortOutput sorted = SortOutput.no)
2.1.3.34 largestPartialIntersectionWeighted void (alias less = "a < b", RangeOfRanges, Range, WeightsAA)(RangeOfRanges ror, Range tgt, WeightsAA weights, SortOutput sorted = SortOutput.no)
2.1.3.35 levenshteinDistance size_t (alias equals = "a == b", Range1, Range2)(Range1 s, Range2 t)
2.1.3.36 levenshteinDistanceAndPath Tuple!(size_t, EditOp[]) (alias equals = "a == b", Range1, Range2)(Range1 s, Range2 t)
2.1.3.37 lowerBound Range (alias pred = "a < b", Range, V)(Range range, V value)
2.1.3.38 makeIndex void (alias less = "a < b", SwapStrategy ss = SwapStrategy.unstable, Range, RangeIndex)(Range r, RangeIndex index)
2.1.3.39 makeIndex void (alias less = "a < b", SwapStrategy ss = SwapStrategy.unstable, Range, RangeIndex)(Range r, RangeIndex index)
2.1.3.40 max MaxType!(T1, T2, T) (T1, T2, T...)(T1 a, T2 b, T xs)
2.1.3.41 min MinType!(T1, T2, T) (T1, T2, T...)(T1 a, T2 b, T xs)
2.1.3.42 minCount Tuple!(ElementType!(Range), size_t) (alias pred = "a < b", Range)(Range range)
2.1.3.43 minPos Range (alias pred = "a < b", Range)(Range range)
2.1.3.44 mismatch Tuple!(Range1, Range2) (alias pred = "a == b", Range1, Range2)(Range1 r1, Range2 r2)
2.1.3.45 move T (T)(ref T src)
2.1.3.46 move void (T)(ref T source, ref T target)
2.1.3.47 moveAll Range2 (Range1, Range2)(Range1 src, Range2 tgt)
2.1.3.48 moveSome Tuple!(Range1, Range2) (Range1, Range2)(Range1 src, Range2 tgt)
2.1.3.49 nWayUnion NWayUnion!(less, RangeOfRanges) (alias less = "a < b", RangeOfRanges)(RangeOfRanges ror)
2.1.3.50 optimisticInsertionSort void (alias less, Range)(Range r)
2.1.3.51 partialIndex void (alias less, SwapStrategy ss = SwapStrategy.unstable, SRange, TRange)(SRange source, TRange target)
2.1.3.52 partialSort void (alias less = "a < b", SwapStrategy ss = SwapStrategy.unstable, Range)(Range r, size_t n)
2.1.3.53 partition Range (alias predicate, SwapStrategy ss = SwapStrategy.unstable, Range)(Range r)
2.1.3.54 remove Range (alias pred, SwapStrategy s = SwapStrategy.stable, Range)(Range range)
2.1.3.55 remove Range (SwapStrategy s = SwapStrategy.stable, Range, Offset...)(Range range, Offset offset)
2.1.3.56 remove Range (SwapStrategy s = SwapStrategy.stable, Range, Offset...)(Range range, Offset offset)
2.1.3.57 reverse void (Range)(Range r)
2.1.3.58 schwartzSort void (alias transform, alias less = "a < b", SwapStrategy ss = SwapStrategy.unstable, Range)(Range r)
2.1.3.59 setDifference SetDifference!(less, R1, R2) (alias less = "a < b", R1, R2)(R1 r1, R2 r2)
2.1.3.60 setIntersection SetIntersection!(less, Rs) (alias less = "a < b", Rs...)(Rs ranges)
2.1.3.61 setSymmetricDifference SetSymmetricDifference!(less, R1, R2) (alias less = "a < b", R1, R2)(R1 r1, R2 r2)
2.1.3.62 setUnion SetUnion!(less, Rs) (alias less = "a < b", Rs...)(Rs rs)
2.1.3.63 skipOver bool (alias pred = "a == b", R, E)(ref R r, E e)
2.1.3.64 skipOver bool (alias pred = "a == b", R1, R2)(ref R1 r1, R2 r2)
2.1.3.65 sort SortedRange!(Range, less) (alias less = "a < b", SwapStrategy ss = SwapStrategy.unstable, Range)(Range r)
2.1.3.66 sortImpl void (alias less, SwapStrategy ss, Range)(Range r)
2.1.3.67 splitter Splitter!(isTerminator, Range) (alias isTerminator, Range)(Range input)
2.1.3.68 splitter Splitter!(Range, Separator) (Range, Separator)(Range r, Separator s)
2.1.3.69 startsWith bool (alias pred = "a == b", R, E)(R doesThisStart, E withThis)
2.1.3.70 startsWith bool (alias pred = "a == b", R1, R2)(R1 doesThisStart, R2 withThis)
2.1.3.71 startsWith uint (alias pred = "a == b", Range, Ranges...)(Range doesThisStart, Ranges withOneOfThese)
2.1.3.72 swap void (T)(ref T lhs, ref T rhs) @trusted pure nothrow
2.1.3.73 swap void (T)(T lhs, T rhs)

if (is(typeof(T.init.proxySwap(T.init))))

2.1.3.74 swapAt void (R)(R r, size_t i1, size_t i2)
2.1.3.75 swapFront void (R1, R2)(R1 r1, R2 r2)
2.1.3.76 swapRanges Tuple!(Range1, Range2) (Range1, Range2)(Range1 r1, Range2 r2)
2.1.3.77 topN void (alias less = "a < b", SwapStrategy ss = SwapStrategy.unstable, Range)(Range r, size_t nth)
2.1.3.78 topN void (alias less = "a < b", SwapStrategy ss = SwapStrategy.unstable, Range1, Range2)(Range1 r1, Range2 r2)
2.1.3.79 topNCopy TRange (alias less = "a < b", SRange, TRange)(SRange source, TRange target, SortOutput sorted = SortOutput.no)
2.1.3.80 topNIndex void (alias less = "a < b", SwapStrategy ss = SwapStrategy.unstable, Range, RangeIndex)(Range r, RangeIndex index, SortOutput sorted = SortOutput.no)
2.1.3.81 topNIndex void (alias less = "a < b", SwapStrategy ss = SwapStrategy.unstable, Range, RangeIndex)(Range r, RangeIndex index, SortOutput sorted = SortOutput.no)
2.1.3.82 topNIndex void (alias less, SwapStrategy ss = SwapStrategy.unstable, SRange, TRange)(SRange source, TRange target)
2.1.3.83 topNIndex void (string less, SwapStrategy ss = SwapStrategy.unstable, SRange, TRange)(SRange source, TRange target)
2.1.3.84 topNIndexImpl void (alias less, bool sortAfter, SwapStrategy ss, SRange, TRange)(SRange source, TRange target)
2.1.3.85 uninitializedFill void (Range, Value)(Range range, Value filler)
2.1.3.86 uniq Uniq!(pred, Range) (alias pred = "a == b", Range)(Range r)
2.1.3.87 until Until!(pred, Range, Sentinel) (alias pred = "a == b", Range, Sentinel)(Range range, Sentinel sentinel, OpenRight openRight = OpenRight.yes)
2.1.3.88 until Until!(pred, Range, void) (alias pred, Range)(Range range, OpenRight openRight = OpenRight.yes)
2.1.3.89 upperBound Range (alias pred = "a < b", Range, V)(Range range, V value)
2.2 std.concurrency

This is a low-level messaging API upon which more structured or restrictive APIs may be built. The general idea is that every messageable entity is represented by a common handle type (called a Cid in this implementation), which allows messages to be sent to in-process threads, on-host processes, and foreign-host processes using the same interface. This is an important aspect of scalability because it allows the components of a program to be spread across available resources with few to no changes to the actual implementation. Right now, only in-process threads are supported and referenced by a more specialized handle called a Tid. It is effectively a subclass of Cid, with additional features specific to in-process messaging. Authors: Sean Kelly

2.2.1 Structs
2.2.1.1 Tid

An opaque type used to represent a logical local process.

2.2.1.1.1 Functions
2.2.1.1.1.1 send void (T...)( T vals )
2.2.2 Classes
2.2.2.1 MessageMismatch : Exception
2.2.2.2 OwnerTerminated : Exception
2.2.2.3 LinkTerminated : Exception
2.2.2.4 PriorityMessageException : Exception
2.2.2.5 MailboxFull : Exception
2.2.3 Attributes
2.2.3.1 OnCrowding enum

These behaviors may be specified when a mailbox is full. enum OnCrowding { block, /// Wait until room is available. throwException, /// Throw a MailboxFull exception. ignore /// Abort the send and return. }

2.2.4 Functions
2.2.4.1 this static ()
2.2.4.2 prioritySend void (T...)( Tid tid, T vals )
2.2.4.3 receive void (T...)( T ops )
2.2.4.4 receiveOnly receiveOnlyRet!(T) (T...)()
2.2.4.5 receiveTimeout bool (T...)( long ms, T ops )
2.2.4.6 send void (T...)( Tid tid, T vals )

Sends the supplied value to the context represented by tid.

2.2.4.7 setMaxMailboxSize void ( Tid tid, size_t messages, bool function(Tid) onCrowdingDoThis )
2.2.4.8 setMaxMailboxSize void ( Tid tid, size_t messages, OnCrowding doThis )
2.2.4.9 spawn Tid (T...)( void function(T) fn, T args )

Executes the supplied function in a new context represented by Tid. The calling context is designated as the owner of the new context. When the owner context terminated an OwnerTerminated message will be sent to the new context, causing an OwnerTerminated exception to be thrown on receive(). Parameters: fn The function to execute. args Arguments to the function. Returns: A Tid representing the new context.

2.2.4.10 spawnLinked Tid (T...)( void function(T) fn, T args )

Executes the supplied function in a new context represented by Tid. This new context is linked to the calling context so that if either it or the calling context terminates a LinkTerminated message will be sent to the other, causing a LinkTerminated exception to be thrown on receive(). The owner relationship from spawn() is preserved as well, so if the link between threads is broken, owner termination will still result in an OwnerTerminated exception to be thrown on receive(). Parameters: fn The function to execute. args Arguments to the function. Returns: A Tid representing the new context.

2.2.4.11 thisTid Tid ()
2.3 std.container

Defines generic containers. Authors: Steven Schveighoffer, Andrei Alexandrescu

2.3.1 Structs
2.3.1.1 TotalContainer(T)

struct TotalContainer(T) An unimplemented container that illustrates a host of primitives that a container may define. It is to some extent the bottom of the conceptual container hierarchy. A given container most often will choose to only implement a subset of these primitives, and define its own additional ones. Adhering to the standard primitive names below allows generic code to work independently of containers.

2.3.1.1.1 Structs
2.3.1.1.1.1 Range

Defines the container's primary range, which embodies one of the ranges defined in std.range. Generally a container may define several types of ranges.

2.3.1.1.1.1.1 Functions
2.3.1.1.1.1.1.1 back T ()
2.3.1.1.1.1.1.2 empty bool ()
2.3.1.1.1.1.1.3 front T ()
2.3.1.1.1.1.1.4 length size_t ()
2.3.1.1.1.1.1.5 moveAt T (size_t i)
2.3.1.1.1.1.1.6 moveBack T ()
2.3.1.1.1.1.1.7 moveFront T ()
2.3.1.1.1.1.1.8 opIndex T (size_t i)
2.3.1.1.1.1.1.9 opIndexAssign void (T value, size_t i)
2.3.1.1.1.1.1.10 opIndexOpAssign void (string op)(T value, uint i)
2.3.1.1.1.1.1.11 popBack void ()
2.3.1.1.1.1.1.12 popFront void ()
2.3.1.1.2 Attributes
2.3.1.1.2.1 KeyType alias T
2.3.1.1.2.2 KeyTypes alias TypeTuple!(T)
2.3.1.1.2.3 ValueType alias T
2.3.1.1.3 Functions
2.3.1.1.3.1 back T ()
2.3.1.1.3.2 capacity size_t ()
2.3.1.1.3.3 clear void ()
2.3.1.1.3.4 dup TotalContainer ()
2.3.1.1.3.5 empty bool ()
2.3.1.1.3.6 equalRange Range (KeyType k)
2.3.1.1.3.7 front T ()
2.3.1.1.3.8 insert size_t (Stuff)(Stuff stuff)
2.3.1.1.3.9 insertAfter size_t (Stuff)(Range r, Stuff stuff)
2.3.1.1.3.10 insertBack size_t (Stuff)(Stuff stuff)
2.3.1.1.3.11 insertBefore size_t (Stuff)(Range r, Stuff stuff)
2.3.1.1.3.12 insertFront size_t (Stuff)(Stuff stuff)
2.3.1.1.3.13 length size_t ()
2.3.1.1.3.14 length void (size_t newLength)
2.3.1.1.3.15 linearInsert size_t (Stuff)(Stuff stuff)
2.3.1.1.3.16 linearRemove Range (Range r)
2.3.1.1.3.17 lowerBound Range (KeyType k)
2.3.1.1.3.18 moveAt T (size_t i)
2.3.1.1.3.19 moveBack T ()
2.3.1.1.3.20 moveFront T ()
2.3.1.1.3.21 opBinary bool (string op)(KeyType k)
2.3.1.1.3.22 opBinary TotalContainer (string op)(Stuff rhs)
2.3.1.1.3.23 opBinaryRight TotalContainer (string op)(Stuff lhs)
2.3.1.1.3.24 opIndex ValueType (KeyType)
2.3.1.1.3.25 opIndexAssign void (KeyType)
2.3.1.1.3.26 opIndexOpAssign void (string op)(KeyType)
2.3.1.1.3.27 opOpAssign void (string op)(Stuff stuff)
2.3.1.1.3.28 opSlice Range ()
2.3.1.1.3.29 opSlice Range (size_t a, size_t b)
2.3.1.1.3.30 remove Range (Range r)
2.3.1.1.3.31 removeAny T ()
2.3.1.1.3.32 removeBack size_t (size_t howMany)
2.3.1.1.3.33 removeBack void ()
2.3.1.1.3.34 removeFront size_t (size_t howMany)
2.3.1.1.3.35 removeFront void ()
2.3.1.1.3.36 removeKey size_t (KeyType k)
2.3.1.1.3.37 replace size_t (Stuff)(Range r, Stuff stuff)
2.3.1.1.3.38 reserve void (size_t e)
2.3.1.1.3.39 stableInsert size_t (Stuff)(Stuff stuff)
2.3.1.1.3.40 stableInsertAfter size_t (Stuff)(Range r, Stuff stuff)
2.3.1.1.3.41 stableInsertBack size_t (T value)
2.3.1.1.3.42 stableInsertBefore size_t (Stuff)(Range r, Stuff stuff)
2.3.1.1.3.43 stableInsertFront size_t (Stuff)(Stuff stuff)
2.3.1.1.3.44 stableLinearInsert size_t (Stuff)(Stuff stuff)
2.3.1.1.3.45 stableLinearRemove Range (Range r)
2.3.1.1.3.46 stableRemove Range (Range r)
2.3.1.1.3.47 stableRemoveAny T ()
2.3.1.1.3.48 stableRemoveBack size_t (size_t howMany)
2.3.1.1.3.49 stableRemoveBack void ()
2.3.1.1.3.50 stableRemoveFront size_t (size_t howMany)
2.3.1.1.3.51 stableRemoveFront void ()
2.3.1.1.3.52 stableReplace size_t (Stuff)(Range r, Stuff stuff)
2.3.1.1.3.53 upperBound Range (KeyType k)
2.3.1.2 SList(T)

struct SList(T) Implements a simple and fast singly-linked list.

2.3.1.2.1 Structs
2.3.1.2.1.1 Range

Defines the container's primary range, which embodies a forward range.

2.3.1.2.1.1.1 Functions
2.3.1.2.1.1.1.1 empty bool () const
2.3.1.2.1.1.1.2 front T ()
2.3.1.2.1.1.1.3 front void (T value)
2.3.1.2.1.1.1.4 moveFront T ()
2.3.1.2.1.1.1.5 popFront void ()
2.3.1.2.1.1.1.6 sameHead bool (Range rhs)
2.3.1.2.1.1.1.7 save Range ()
2.3.1.2.2 Attributes
2.3.1.2.2.1 insert alias insertFront
2.3.1.2.2.2 stableInsert alias insert
2.3.1.2.2.3 stableInsertAfter alias insertAfter
2.3.1.2.2.4 stableInsertFront alias insertFront
2.3.1.2.2.5 stableLinearRemove alias linearRemove
2.3.1.2.2.6 stableRemoveAny alias removeAny
2.3.1.2.2.7 stableRemoveFront alias removeFront
2.3.1.2.2.8 stableRemoveFront alias removeFront
2.3.1.2.3 Functions
2.3.1.2.3.1 this (U)(U[] values...)
2.3.1.2.3.2 this (Stuff)(Stuff stuff)
2.3.1.2.3.3 clear void ()
2.3.1.2.3.4 dup SList ()
2.3.1.2.3.5 empty bool () const
2.3.1.2.3.6 front T ()
2.3.1.2.3.7 front void (T value)
2.3.1.2.3.8 insertAfter size_t (Stuff)(Range r, Stuff stuff)
2.3.1.2.3.9 insertAfter size_t (Stuff)(Take!Range r, Stuff stuff)
2.3.1.2.3.10 insertFront size_t (Stuff)(Stuff stuff)
2.3.1.2.3.11 insertFront size_t (Stuff)(Stuff stuff)
2.3.1.2.3.12 linearRemove Range (Range r)
2.3.1.2.3.13 linearRemove Range (Take!Range r)
2.3.1.2.3.14 opBinary SList (string op, Stuff)(Stuff rhs)
2.3.1.2.3.15 opEquals bool (ref const SList rhs) const
2.3.1.2.3.16 opSlice Range ()
2.3.1.2.3.17 removeAny T ()
2.3.1.2.3.18 removeFront size_t (size_t howMany)
2.3.1.2.3.19 removeFront void ()
2.3.1.3 BinaryHeap( see note )

struct BinaryHeap(Store, alias less = "a < b") if (isRandomAccessRange!(Store) || isRandomAccessRange!(typeof(Store.init[]))) Implements a binary heap container on top of a given random-access range type (usually T[]) or a random-access container type (usually Array!T). The documentation of BinaryHeap will refer to the underlying range or container as the store of the heap. The binary heap induces structure over the underlying store such that accessing the largest element (by using the front property) is a Ο(1) operation and extracting it (by using the removeFront() method) is done fast in Ο(log n) time. If less is the less-than operator, which is the default option, then BinaryHeap defines a so-called max-heap that optimizes extraction of the largest elements. To define a min-heap, instantiate BinaryHeap with "a > b" as its predicate. Simply extracting elements from a BinaryHeap container is tantamount to lazily fetching elements of Store in descending order. Extracting elements from the BinaryHeap to completion leaves the underlying store sorted in ascending order but, again, yields elements in descending order. If Store is a range, the BinaryHeap cannot grow beyond the size of that range. If Store is a container that supports insertBack, the BinaryHeap may grow by adding elements to the container.

2.3.1.3.1 Functions
2.3.1.3.1.1 this (Store s, size_t initialSize = size_t.max)
2.3.1.3.1.2 acquire void (Store s, size_t initialSize = size_t.max)
2.3.1.3.1.3 assume void (Store s, size_t initialSize = size_t.max)
2.3.1.3.1.4 capacity size_t ()
2.3.1.3.1.5 clear void ()
2.3.1.3.1.6 conditionalInsert bool (ElementType!Store value)
2.3.1.3.1.7 dup BinaryHeap ()
2.3.1.3.1.8 empty bool ()
2.3.1.3.1.9 front ElementType!Store ()
2.3.1.3.1.10 insert size_t (ElementType!Store value)
2.3.1.3.1.11 length size_t ()
2.3.1.3.1.12 release auto ()
2.3.1.3.1.13 removeAny ElementType!Store ()
2.3.1.3.1.14 removeFront void ()
2.3.1.3.1.15 replaceFront void (ElementType!Store value)
2.3.1.4 Array(T)

struct Array(T) Array type with deterministic control of memory. The memory allocated for the array is reclaimed as soon as possible; there is no reliance on the garbage collector. Array uses malloc and free for managing its own memory.

2.3.1.4.1 Structs
2.3.1.4.1.1 Range

Defines the container's primary range, which is a random-access range.

2.3.1.4.1.1.1 Functions
2.3.1.4.1.1.1.1 this (Array data, size_t a, size_t b)
2.3.1.4.1.1.1.2 empty bool () const
2.3.1.4.1.1.1.3 front T ()
2.3.1.4.1.1.1.4 front void (T value)
2.3.1.4.1.1.1.5 moveAt T (size_t i)
2.3.1.4.1.1.1.6 moveBack T ()
2.3.1.4.1.1.1.7 moveFront T ()
2.3.1.4.1.1.1.8 opIndex T (size_t i)
2.3.1.4.1.1.1.9 opIndexAssign void (T value, size_t i)
2.3.1.4.1.1.1.10 opIndexOpAssign void (string op)(T value, size_t i)
2.3.1.4.1.1.1.11 popFront void ()
2.3.1.4.1.1.1.12 save Range ()
2.3.1.4.2 Attributes
2.3.1.4.2.1 insert alias insertBack
2.3.1.4.2.2 stableLinearRemove alias remove
2.3.1.4.2.3 stableRemoveAny alias removeAny
2.3.1.4.2.4 stableRemoveBack alias removeBack
2.3.1.4.2.5 stableRemoveBack alias removeBack
2.3.1.4.3 Functions
2.3.1.4.3.1 this (Array data, size_t a, size_t b)
2.3.1.4.3.2 this (U)(U[] values...)
2.3.1.4.3.3 back T ()
2.3.1.4.3.4 back void (T value)
2.3.1.4.3.5 capacity size_t ()
2.3.1.4.3.6 clear void ()
2.3.1.4.3.7 dup Array ()
2.3.1.4.3.8 empty bool () const
2.3.1.4.3.9 front T ()
2.3.1.4.3.10 front void (T value)
2.3.1.4.3.11 insertAfter size_t (Stuff)(Range r, Stuff stuff)
2.3.1.4.3.12 insertBack size_t (Stuff)(Stuff stuff)
2.3.1.4.3.13 insertBefore size_t (Stuff)(Range r, Stuff stuff)
2.3.1.4.3.14 insertBefore size_t (Stuff)(Range r, Stuff stuff)
2.3.1.4.3.15 length size_t () const
2.3.1.4.3.16 length void (size_t newLength)
2.3.1.4.3.17 linearRemove Range (Range r)
2.3.1.4.3.18 opBinary Array (string op, Stuff)(Stuff stuff)
2.3.1.4.3.19 opDollar size_t () const
2.3.1.4.3.20 opEquals bool (ref const Array rhs) const
2.3.1.4.3.21 opIndex T (size_t i)
2.3.1.4.3.22 opIndexAssign void (T value, size_t i)
2.3.1.4.3.23 opIndexOpAssign void (string op)(T value, size_t i)
2.3.1.4.3.24 opOpAssign void (string op, Stuff)(Stuff stuff)
2.3.1.4.3.25 opSlice Range ()
2.3.1.4.3.26 opSlice Range (size_t a, size_t b)
2.3.1.4.3.27 removeAny T ()
2.3.1.4.3.28 removeBack size_t (size_t howMany)
2.3.1.4.3.29 removeBack void ()
2.3.1.4.3.30 replace size_t (Stuff)(Range r, Stuff stuff)
2.3.1.4.3.31 replace size_t (Stuff)(Range r, Stuff stuff)
2.3.1.4.3.32 reserve void (size_t elements)
2.3.1.5 RBNode(V)

struct RBNode(V) Implementation for a Red Black node for use in a Red Black Tree (see below) this implementation assumes we have a marker Node that is the parent of the root Node. This marker Node is not a valid Node, but marks the end of the collection. The root is the left child of the marker Node, so it is always last in the collection. The marker Node is passed in to the setColor function, and the Node which has this Node as its parent is assumed to be the root Node. A Red Black tree should have O(lg(n)) insertion, removal, and search time.

2.3.1.5.1 Attributes
2.3.1.5.1.1 color Color
2.3.1.5.1.2 Color enum : byte
2.3.1.5.1.3 Node alias RBNode*
2.3.1.5.1.4 value V
2.3.1.5.2 Functions
2.3.1.5.2.1 dup Node ()
2.3.1.5.2.2 dup Node (scope Node delegate(V v) alloc)
2.3.1.5.2.3 isLeftNode bool () const
2.3.1.5.2.4 left Node ()
2.3.1.5.2.5 left Node (Node newNode)
2.3.1.5.2.6 leftmost Node ()
2.3.1.5.2.7 next Node ()
2.3.1.5.2.8 parent Node ()
2.3.1.5.2.9 prev Node ()
2.3.1.5.2.10 remove Node (Node end)
2.3.1.5.2.11 right Node ()
2.3.1.5.2.12 right Node (Node newNode)
2.3.1.5.2.13 rightmost Node ()
2.3.1.5.2.14 rotateL Node ()
2.3.1.5.2.15 rotateR Node ()
2.3.1.5.2.16 setColor void (Node end)
2.3.1.6 RedBlackTree( see note )

struct RedBlackTree(T, alias less = "a < b", bool allowDuplicates = false) if (is(typeof(less(T.init, T.init)) == bool) || is(typeof(less) == string)) Implementation of a red-black tree container. All inserts, removes, searches, and any function in general has complexity of Ο(lg(n)). To use a different comparison than "a < b", pass a different operator string that can be used by std.functional.binaryFun, or pass in a function, delegate, functor, or any type where less(a, b) results in a bool value. Note that less should produce a strict ordering. That is, for two unequal elements a and b, less(a, b) == !less(b, a). less(a, a) should always equal false. If allowDuplicates is set to true, then inserting the same element more than once continues to add more elements. If it is false, duplicate elements are ignored on insertion. If duplicates are allowed, then new elements are inserted after all existing duplicate elements.

2.3.1.6.1 Structs
2.3.1.6.1.1 Range

Red Black Tree range

2.3.1.6.1.1.1 Functions
2.3.1.6.1.1.1.1 back Elem ()
2.3.1.6.1.1.1.2 empty bool () const
2.3.1.6.1.1.1.3 front Elem ()
2.3.1.6.1.1.1.4 popBack void ()
2.3.1.6.1.1.1.5 popFront void ()
2.3.1.6.1.1.1.6 save Range ()
2.3.1.6.2 Attributes
2.3.1.6.2.1 _less alias binaryFun!(less)
2.3.1.6.2.2 _less alias less
2.3.1.6.2.3 Elem alias T
2.3.1.6.2.4 insert alias stableInsert
2.3.1.6.3 Functions
2.3.1.6.3.1 this (U)(U[] elems...)
2.3.1.6.3.2 this (Stuff)(Stuff stuff)
2.3.1.6.3.3 back Elem ()
2.3.1.6.3.4 clear void ()
2.3.1.6.3.5 dup RedBlackTree ()
2.3.1.6.3.6 empty bool ()
2.3.1.6.3.7 equalRange Range (Elem e)
2.3.1.6.3.8 front Elem ()
2.3.1.6.3.9 lowerBound Range (Elem e)
2.3.1.6.3.10 opBinaryRight bool (string op)(Elem e)
2.3.1.6.3.11 opSlice Range ()
2.3.1.6.3.12 remove Range (Range r)
2.3.1.6.3.13 removeAny Elem ()
2.3.1.6.3.14 removeBack void ()
2.3.1.6.3.15 removeFront void ()
2.3.1.6.3.16 stableInsert size_t (Stuff)(Stuff stuff)
2.3.1.6.3.17 upperBound Range (Elem e)
2.3.2 Functions
2.3.2.1 make Container (Container, T...)(T arguments)
2.3.2.2 heapify BinaryHeap!Store (Store)(Store s, size_t initialSize = size_t.max)
2.4 std.datetime

This module provides: * Types to represent points in time: SysTime, Date, TimeOfDay, and DateTime. * Types to represent durations of time. * Types to represent intervals of time. * Types to represent ranges over intervals of time. * Types to represent time zones (used by SysTime). * A platform-independent, high precision stopwatch type: StopWatch * Benchmarking functions. * Various helper functions. Three of the main concepts used in this module are time points, time durations, and time intervals. Authors: Jonathan M Davis and Kato Shoichi

2.4.1 Structs
2.4.1.1 Date

Represents a date in the Proleptic Gregorian Calendar ranging from 32,768 B.C. to 32,767 A.D. Positive years are A.D. Non-positive years are B.C. Year, month, and day are kept separately internally so that Date is optimized for calendar-based operations. Date uses the Proleptic Gregorian Calendar, so it assumes the Gregorian leap year calculations for its entire length. And, as per ISO 8601, it also treats 1 B.C. as year 0. So, 1 B.C. is 0, 2 B.C. is -1, etc. Use yearBC if want B.C. as a positive integer with 1 B.C. being the year prior to 1 A.D. Year 0 is a leap year.

2.4.1.1.1 Functions
2.4.1.1.1.1 this (int day) pure nothrow
2.4.1.1.1.2 this (int year, int month, int day) pure
2.4.1.1.1.3 add void (string units)(long months, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) pure nothrow

if(units == "months")

2.4.1.1.1.4 add void (string units)(long value, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) pure nothrow

if(units == "years")

2.4.1.1.1.5 day ubyte () const pure nothrow
2.4.1.1.1.6 day void (int day) pure
2.4.1.1.1.7 dayOfGregorianCal int () const pure nothrow
2.4.1.1.1.8 dayOfGregorianCal void (int day) pure nothrow
2.4.1.1.1.9 dayOfWeek DayOfWeek () const pure nothrow
2.4.1.1.1.10 dayOfYear ushort () const pure nothrow
2.4.1.1.1.11 dayOfYear void (int day) pure
2.4.1.1.1.12 diffMonths int (in Date rhs) const pure nothrow
2.4.1.1.1.13 endOfMonth Date () const pure nothrow
2.4.1.1.1.14 endOfMonthDay ubyte () const pure nothrow
2.4.1.1.1.15 fromISOExtendedString static Date (S)(in S isoExtString)
2.4.1.1.1.16 fromISOString static Date (S)(in S isoString)
2.4.1.1.1.17 fromSimpleString static Date (S)(in S simpleString)
2.4.1.1.1.18 isAD bool () const pure nothrow
2.4.1.1.1.19 isLeapYear bool () const pure nothrow
2.4.1.1.1.20 isoWeek ubyte () const pure nothrow
2.4.1.1.1.21 julianDay long () const pure nothrow
2.4.1.1.1.22 max static Date () pure nothrow
2.4.1.1.1.23 min static Date () pure nothrow
2.4.1.1.1.24 modJulianDay long () const pure nothrow
2.4.1.1.1.25 month Month () const pure nothrow
2.4.1.1.1.26 month void (Month month) pure
2.4.1.1.1.27 opBinary Date (string op, D)(in D duration) const pure nothrow

if((op == "+" || op == "-") && (is(Unqual!D == Duration) || is(Unqual!D == TickDuration)))

2.4.1.1.1.28 opBinary Duration (string op)(in Date rhs) const pure nothrow

if(op == "-")

2.4.1.1.1.29 opCmp int (in Date rhs) const pure nothrow
2.4.1.1.1.30 opOpAssign Date (string op, D)(in D duration) pure nothrow

if((op == "+" || op == "-") && (is(Unqual!D == Duration) || is(Unqual!D == TickDuration)))

2.4.1.1.1.31 roll void (string units)(long days) pure nothrow

if(units == "days")

2.4.1.1.1.32 roll void (string units)(long months, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) pure nothrow

if(units == "months")

2.4.1.1.1.33 roll void (string units)(long value, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) pure nothrow

if(units == "years")

2.4.1.1.1.34 toISOExtendedString string () const nothrow

if(isSomeString!(S))

2.4.1.1.1.35 toISOString string () const nothrow

if(isSomeString!S)

2.4.1.1.1.36 toSimpleString string () const nothrow

if(isSomeString!(S))

2.4.1.1.1.37 toString string ()
2.4.1.1.1.38 toString string () const nothrow
2.4.1.1.1.39 year short () const pure nothrow
2.4.1.1.1.40 year void (int year) pure
2.4.1.1.1.41 yearBC ushort () const pure
2.4.1.1.1.42 yearBC void (int year) pure
2.4.1.2 DateTime

Combines the Date and TimeOfDay structs to give you an object which holds both the date and the time. It is optimized for calendar-based operations and has no concept of time zone. If you want an object which is optimized for time operations based on the system time, then use SysTime. SysTime has a concept of time zone and has much higher precision (hnsecs). DateTime is intended primarily for calendar-based uses rather than precise time operations.

2.4.1.2.1 Functions
2.4.1.2.1.1 this (in Date date, in TimeOfDay tod = TimeOfDay.init) pure nothrow
2.4.1.2.1.2 this (int year, int month, int day, int hour = 0, int minute = 0, int second = 0) pure
2.4.1.2.1.3 add void (string units)(long value, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) pure nothrow

if(units == "years" || units == "months")

2.4.1.2.1.4 date Date () const pure nothrow
2.4.1.2.1.5 date void (in Date date) pure nothrow
2.4.1.2.1.6 day ubyte () const pure nothrow
2.4.1.2.1.7 day void (int day) pure
2.4.1.2.1.8 dayOfGregorianCal int () const pure nothrow
2.4.1.2.1.9 dayOfGregorianCal void (int days) pure nothrow
2.4.1.2.1.10 dayOfWeek DayOfWeek () const pure nothrow
2.4.1.2.1.11 dayOfYear ushort () const pure nothrow
2.4.1.2.1.12 dayOfYear void (int day) pure
2.4.1.2.1.13 diffMonths int (in DateTime rhs) const pure nothrow
2.4.1.2.1.14 endOfMonth DateTime () const pure nothrow
2.4.1.2.1.15 endOfMonthDay ubyte () const pure nothrow
2.4.1.2.1.16 fromISOExtendedString static DateTime (S)(in S isoExtString)

if(isSomeString!(S))

2.4.1.2.1.17 fromISOString static DateTime (S)(in S isoString)

if(isSomeString!S)

2.4.1.2.1.18 fromSimpleString static DateTime (S)(in S simpleString)

if(isSomeString!(S))

2.4.1.2.1.19 hour ubyte () const pure nothrow
2.4.1.2.1.20 hour void (int hour) pure
2.4.1.2.1.21 isAD bool () const pure nothrow
2.4.1.2.1.22 isLeapYear bool () const pure nothrow
2.4.1.2.1.23 isoWeek ubyte () const pure nothrow
2.4.1.2.1.24 julianDay long () const pure nothrow
2.4.1.2.1.25 max static DateTime () pure nothrow
2.4.1.2.1.26 min static DateTime () pure nothrow
2.4.1.2.1.27 minute ubyte () const pure nothrow
2.4.1.2.1.28 minute void (int minute) pure
2.4.1.2.1.29 modJulianDay long () const pure nothrow
2.4.1.2.1.30 month Month () const pure nothrow
2.4.1.2.1.31 month void (Month month) pure
2.4.1.2.1.32 opBinary DateTime (string op, D)(in D duration) const pure nothrow

if((op == "+" || op == "-") && (is(Unqual!D == Duration) || is(Unqual!D == TickDuration)))

2.4.1.2.1.33 opBinary Duration (string op)(in DateTime rhs) const pure nothrow

if(op == "-")

2.4.1.2.1.34 opCmp int (in DateTime rhs) const pure nothrow
2.4.1.2.1.35 opOpAssign DateTime (string op, D)(in D duration) pure nothrow

if((op == "+" || op == "-") && (is(Unqual!D == Duration) || is(Unqual!D == TickDuration)))

2.4.1.2.1.36 roll void (string units)(long days) pure nothrow

if(units == "days")

2.4.1.2.1.37 roll void (string units)(long value) pure nothrow

if(units == "years" || units == "months")

2.4.1.2.1.38 roll void (string units)(long value, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) pure nothrow

if(units == "hours" || units == "minutes" || units == "seconds")

2.4.1.2.1.39 second ubyte () const pure nothrow
2.4.1.2.1.40 second void (int second) pure
2.4.1.2.1.41 timeOfDay TimeOfDay () const pure nothrow
2.4.1.2.1.42 timeOfDay void (in TimeOfDay tod) pure nothrow
2.4.1.2.1.43 toISOExtendedString string () const nothrow
2.4.1.2.1.44 toISOString string () const nothrow
2.4.1.2.1.45 toSimpleString string () const nothrow
2.4.1.2.1.46 toString string ()
2.4.1.2.1.47 toString string () const nothrow
2.4.1.2.1.48 year short () const pure nothrow
2.4.1.2.1.49 year void (int year) pure
2.4.1.2.1.50 yearBC short () const pure
2.4.1.2.1.51 yearBC void (int year) pure
2.4.1.3 Interval(TP)

Represents an interval of time. An Interval has a starting point and an end point. The interval of time is therefore the time starting at the starting point up to, but not including, the end point. e.g. [January 5th, 2010 - March 10th, 2010) [05:00:30 - 12:00:00) [1982-01-04T08:59:00 - 2010-07-04T12:00:00) [January 5th, 2010 - March 10th, 2010) [05:00:30 - 12:00:00) [1982-01-04T08:59:00 - 2010-07-04T12:00:00) A range can be obtained from an Interval, allowing you to iterate over that interval, with the exact time points which are iterated over depending on the function which generates the range.

2.4.1.3.1 Functions
2.4.1.3.1.1 this (D)(in TP begin, in D duration) pure

if(__traits(compiles, begin + duration))

2.4.1.3.1.2 this (U)(in TP begin, in U end) pure

if(is(Unqual!TP == Unqual!U))

2.4.1.3.1.3 begin TP () const pure nothrow
2.4.1.3.1.4 begin void (TP timePoint) pure
2.4.1.3.1.5 bwdRange IntervalRange!(TP, Direction.bwd) (TP delegate(in TP) func, PopFirst popFirst = PopFirst.no) const
2.4.1.3.1.6 contains bool (in Interval interval) const pure
2.4.1.3.1.7 contains bool (in NegInfInterval!TP interval) const pure
2.4.1.3.1.8 contains bool (in PosInfInterval!TP interval) const pure
2.4.1.3.1.9 contains bool (in TP timePoint) const pure
2.4.1.3.1.10 empty bool () const pure nothrow
2.4.1.3.1.11 end TP () const pure nothrow
2.4.1.3.1.12 end void (TP timePoint) pure
2.4.1.3.1.13 expand void (D)(D duration, Direction dir = Direction.both) pure

if(__traits(compiles, begin + duration))

2.4.1.3.1.14 expand void (T)(T years, T months = 0, AllowDayOverflow allowOverflow = AllowDayOverflow.yes, Direction dir = Direction.both)

if(isIntegral!T)

2.4.1.3.1.15 fwdRange IntervalRange!(TP, Direction.fwd) (TP delegate(in TP) func, PopFirst popFirst = PopFirst.no) const
2.4.1.3.1.16 intersection Interval (in Interval interval) const
2.4.1.3.1.17 intersection Interval (in NegInfInterval!TP interval) const
2.4.1.3.1.18 intersection Interval (in PosInfInterval!TP interval) const
2.4.1.3.1.19 intersects bool (in Interval interval) const pure
2.4.1.3.1.20 intersects bool (in NegInfInterval!TP interval) const pure
2.4.1.3.1.21 intersects bool (in PosInfInterval!TP interval) const pure
2.4.1.3.1.22 isAdjacent bool (in Interval interval) const pure
2.4.1.3.1.23 isAdjacent bool (in NegInfInterval!TP interval) const pure
2.4.1.3.1.24 isAdjacent bool (in PosInfInterval!TP interval) const pure
2.4.1.3.1.25 isAfter bool (in Interval interval) const pure
2.4.1.3.1.26 isAfter bool (in NegInfInterval!TP interval) const pure
2.4.1.3.1.27 isAfter bool (in PosInfInterval!TP interval) const pure
2.4.1.3.1.28 isAfter bool (in TP timePoint) const pure
2.4.1.3.1.29 isBefore bool (in Interval interval) const pure
2.4.1.3.1.30 isBefore bool (in NegInfInterval!TP interval) const pure
2.4.1.3.1.31 isBefore bool (in PosInfInterval!TP interval) const pure
2.4.1.3.1.32 isBefore bool (in TP timePoint) const pure
2.4.1.3.1.33 length typeof(end - begin) () const pure nothrow
2.4.1.3.1.34 merge Interval (in Interval interval) const
2.4.1.3.1.35 merge NegInfInterval!TP (in NegInfInterval!TP interval) const
2.4.1.3.1.36 merge PosInfInterval!TP (in PosInfInterval!TP interval) const
2.4.1.3.1.37 opAssign Interval (const ref Interval rhs) pure nothrow
2.4.1.3.1.38 opAssign Interval (Interval rhs) pure nothrow
2.4.1.3.1.39 shift void (D)(D duration) pure

if(__traits(compiles, begin + duration))

2.4.1.3.1.40 shift void (T)(T years, T months = 0, AllowDayOverflow allowOverflow = AllowDayOverflow.yes)

if(isIntegral!T)

2.4.1.3.1.41 span Interval (in Interval interval) const pure
2.4.1.3.1.42 span NegInfInterval!TP (in NegInfInterval!TP interval) const pure
2.4.1.3.1.43 span PosInfInterval!TP (in PosInfInterval!TP interval) const pure
2.4.1.3.1.44 toString string ()
2.4.1.3.1.45 toString string () const nothrow
2.4.1.4 IntervalRange(TP, Direction dir)

if(isTimePoint!TP && dir != Direction.both) A range over an Interval. IntervalRange is only ever constructed by Interval. However, when it is constructed, it is given a function, func, which is used to generate the time points which are iterated over. func takes a time point and returns a time point of the same type. So, for instance, if you had an Interval!Date, and you wanted to iterate over all of the days in that interval, you would pass a function to Interval's fwdRange where that function took a Date and returned a Date which was one day later. That function would then be used by IntervalRange's popFront to iterate over the Dates in the interval. If dir == Direction.fwd, then a range iterates forward in time, whereas if dir == Direction.bwd, then it iterates backwards in time. So, if dir == Direction.fwd then front == interval.begin, whereas if dir == Direction.bwd then front == interval.end. func must generate a time point going in the proper direction of iteration, or a DateTimeException will be thrown. So, if you're iterating forward in time, the time point that func generates must be later in time than the one passed to it. If it's either identical or earlier in time, then a DateTimeException will be thrown. If you're iterating backwards, then the generated time point must be before the time point which was passed in. If the generated time point is ever passed the edge of the range in the proper direction, then the edge of that range will be used instead. So, if iterating forward, and the generated time point is past the interval's end, then front becomes end. If iterating backwards, and the generated time point is before begin, then front becomes begin. In either case, the range would then be empty. Also note that while normally the begin of an interval is included in it and its end is excluded from it, if dir == Direction.bwd, then begin is treated as excluded and end is treated as included. This allows for the same behavior in both directions. This works because none of Interval's functions which care about whether begin or end is included or excluded are ever called by IntervalRange. interval returns a normal interval, regardless of whether dir == Direction.fwd or if dir == Direction.bwd, so any Interval functions which are called on it which care about whether begin or end are included or excluded will treat begin as included and end as excluded.

2.4.1.4.1 Functions
2.4.1.4.1.1 direction Direction () const pure nothrow
2.4.1.4.1.2 empty bool () const pure nothrow
2.4.1.4.1.3 front TP () const pure
2.4.1.4.1.4 func TP delegate(in TP) () pure nothrow @property
2.4.1.4.1.5 interval Interval!TP () const pure nothrow
2.4.1.4.1.6 opAssign IntervalRange (ref IntervalRange rhs) pure nothrow
2.4.1.4.1.7 popFront void ()
2.4.1.4.1.8 save IntervalRange () pure nothrow
2.4.1.5 NegInfInterval(TP)

Represents an interval of time which has negative infinity as its starting point. Any ranges which iterate over a NegInfInterval are infinite. So, the main purpose of using NegInfInterval is to create an infinite range which starts at negative infinity and goes to a fixed end point. You would then iterate over it in reverse.

2.4.1.5.1 Functions
2.4.1.5.1.1 this (in TP end) pure nothrow
2.4.1.5.1.2 bwdRange NegInfIntervalRange!(TP) (TP delegate(in TP) func, PopFirst popFirst = PopFirst.no) const
2.4.1.5.1.3 contains bool (in Interval!TP interval) const pure
2.4.1.5.1.4 contains bool (in NegInfInterval interval) const pure nothrow
2.4.1.5.1.5 contains bool (in PosInfInterval!TP interval) const pure nothrow
2.4.1.5.1.6 contains bool (TP timePoint) const pure nothrow
2.4.1.5.1.7 empty bool () const pure nothrow
2.4.1.5.1.8 end TP () const pure nothrow
2.4.1.5.1.9 end void (TP timePoint) pure nothrow
2.4.1.5.1.10 expand void (D)(D duration) pure nothrow

if(__traits(compiles, end + duration))

2.4.1.5.1.11 expand void (T)(T years, T months = 0, AllowDayOverflow allowOverflow = AllowDayOverflow.yes)

if(__traits(compiles, end + duration))

2.4.1.5.1.12 intersection Interval!TP (in Interval!TP interval) const
2.4.1.5.1.13 intersection Interval!TP (in PosInfInterval!TP interval) const
2.4.1.5.1.14 intersection NegInfInterval (in NegInfInterval interval) const nothrow
2.4.1.5.1.15 intersects bool (in Interval!TP interval) const pure
2.4.1.5.1.16 intersects bool (in NegInfInterval!TP interval) const pure nothrow
2.4.1.5.1.17 intersects bool (in PosInfInterval!TP interval) const pure nothrow
2.4.1.5.1.18 isAdjacent bool (in Interval!TP interval) const pure
2.4.1.5.1.19 isAdjacent bool (in NegInfInterval interval) const pure nothrow
2.4.1.5.1.20 isAdjacent bool (in PosInfInterval!TP interval) const pure nothrow
2.4.1.5.1.21 isAfter bool (in Interval!TP interval) const pure
2.4.1.5.1.22 isAfter bool (in NegInfInterval interval) const pure nothrow
2.4.1.5.1.23 isAfter bool (in PosInfInterval!TP interval) const pure nothrow
2.4.1.5.1.24 isAfter bool (in TP timePoint) const pure nothrow
2.4.1.5.1.25 isBefore bool (in Interval!TP interval) const pure
2.4.1.5.1.26 isBefore bool (in NegInfInterval interval) const pure nothrow
2.4.1.5.1.27 isBefore bool (in PosInfInterval!TP interval) const pure nothrow
2.4.1.5.1.28 isBefore bool (in TP timePoint) const pure nothrow
2.4.1.5.1.29 merge NegInfInterval (in Interval!TP interval) const
2.4.1.5.1.30 merge NegInfInterval (in NegInfInterval interval) const pure nothrow
2.4.1.5.1.31 opAssign NegInfInterval (const ref NegInfInterval rhs) pure nothrow
2.4.1.5.1.32 opAssign NegInfInterval (NegInfInterval rhs) pure nothrow
2.4.1.5.1.33 shift void (D)(D duration) pure nothrow

if(__traits(compiles, end + duration))

2.4.1.5.1.34 shift void (T)(T years, T months = 0, AllowDayOverflow allowOverflow = AllowDayOverflow.yes)

if(isIntegral!T)

2.4.1.5.1.35 span NegInfInterval (in Interval!TP interval) const pure
2.4.1.5.1.36 span NegInfInterval (in NegInfInterval interval) const pure nothrow
2.4.1.5.1.37 toString string ()
2.4.1.5.1.38 toString string () const nothrow
2.4.1.6 NegInfIntervalRange(TP)

A range over a NegInfInterval. It is an infinite range. NegInfIntervalRange is only ever constructed by NegInfInterval. However, when it is constructed, it is given a function, func, which is used to generate the time points which are iterated over. func takes a time point and returns a time point of the same type. So, for instance, if you had a NegInfInterval!Date, and you wanted to iterate over all of the days in that interval, you would pass a function to NegInfInterval's bwdRange where that function took a Date and returned a Date which was one day earlier. That function would then be used by NegInfIntervalRange's popFront to iterate over the Dates in the interval - though obviously, since the range is infinite, you would use a function such as std.range.take with it rather than iterating over all of the dates. As the interval goes to negative infinity, the range is always iterated over backwards, never forwards. func must generate a time point going in the proper direction of iteration, or a DateTimeException will be thrown. So, the time points that func generates must be earlier in time than the one passed to it. If it's either identical or later in time, then a DateTimeException will be thrown. Also note that while normally the end of an interval is excluded from it, NegInfIntervalRange treats it as if it were included. This allows for the same behavior as you get with PosInfIntervalRange. This works because none of NegInfInterval's functions which care about whether end is included or excluded are ever called by NegInfIntervalRange. interval returns a normal interval, so any NegInfInterval functions which are called on it which care about whether end is included or excluded will treat end as excluded.

2.4.1.6.1 Functions
2.4.1.6.1.1 front TP () const pure nothrow
2.4.1.6.1.2 func TP delegate(in TP) () pure nothrow
2.4.1.6.1.3 interval NegInfInterval!TP () const pure nothrow
2.4.1.6.1.4 popFront void ()
2.4.1.6.1.5 save NegInfIntervalRange () pure nothrow
2.4.1.7 PosInfInterval(TP)

if(isTimePoint!TP) Represents an interval of time which has positive infinity as its end point. Any ranges which iterate over a PosInfInterval are infinite. So, the main purpose of using PosInfInterval is to create an infinite range which starts at a fixed point in time and goes to positive infinity.

2.4.1.7.1 Functions
2.4.1.7.1.1 this (in TP begin) pure nothrow
2.4.1.7.1.2 begin TP () const pure nothrow
2.4.1.7.1.3 begin void (TP timePoint) pure nothrow
2.4.1.7.1.4 contains bool (in Interval!TP interval) const pure
2.4.1.7.1.5 contains bool (in NegInfInterval!TP interval) const pure nothrow
2.4.1.7.1.6 contains bool (in PosInfInterval interval) const pure nothrow
2.4.1.7.1.7 contains bool (TP timePoint) const pure nothrow
2.4.1.7.1.8 empty bool () const pure nothrow
2.4.1.7.1.9 expand void (D)(D duration) pure nothrow

if(__traits(compiles, end + duration))

2.4.1.7.1.10 expand void (T)(T years, T months = 0, AllowDayOverflow allowOverflow = AllowDayOverflow.yes)
2.4.1.7.1.11 fwdRange PosInfIntervalRange!(TP) (TP delegate(in TP) func, PopFirst popFirst = PopFirst.no) const
2.4.1.7.1.12 intersection Interval!TP (in Interval!TP interval) const
2.4.1.7.1.13 intersection Interval!TP (in NegInfInterval!TP interval) const
2.4.1.7.1.14 intersection PosInfInterval (in PosInfInterval interval) const pure nothrow
2.4.1.7.1.15 intersects bool (in Interval!TP interval) const pure
2.4.1.7.1.16 intersects bool (in NegInfInterval!TP interval) const pure nothrow
2.4.1.7.1.17 intersects bool (in PosInfInterval interval) const pure nothrow
2.4.1.7.1.18 isAdjacent bool (in Interval!TP interval) const pure
2.4.1.7.1.19 isAdjacent bool (in NegInfInterval!TP interval) const pure nothrow
2.4.1.7.1.20 isAdjacent bool (in PosInfInterval interval) const pure nothrow
2.4.1.7.1.21 isAfter bool (in Interval!TP interval) const pure
2.4.1.7.1.22 isAfter bool (in NegInfInterval!TP interval) const pure nothrow
2.4.1.7.1.23 isAfter bool (in PosInfInterval interval) const pure nothrow
2.4.1.7.1.24 isAfter bool (in TP timePoint) const pure nothrow
2.4.1.7.1.25 isBefore bool (in Interval!TP interval) const pure
2.4.1.7.1.26 isBefore bool (in NegInfInterval!TP interval) const pure nothrow
2.4.1.7.1.27 isBefore bool (in PosInfInterval interval) const pure nothrow
2.4.1.7.1.28 isBefore bool (in TP timePoint) const pure nothrow
2.4.1.7.1.29 merge PosInfInterval (in Interval!TP interval) const
2.4.1.7.1.30 merge PosInfInterval (in PosInfInterval interval) const pure nothrow
2.4.1.7.1.31 opAssign PosInfInterval (const ref PosInfInterval rhs) pure nothrow
2.4.1.7.1.32 opAssign PosInfInterval (PosInfInterval rhs) pure nothrow
2.4.1.7.1.33 shift void (D)(D duration) pure nothrow

if(__traits(compiles, end + duration))

2.4.1.7.1.34 shift void (T)(T years, T months = 0, AllowDayOverflow allowOverflow = AllowDayOverflow.yes)
2.4.1.7.1.35 span PosInfInterval (in Interval!TP interval) const pure
2.4.1.7.1.36 span PosInfInterval (in PosInfInterval interval) const pure nothrow
2.4.1.7.1.37 toString string ()
2.4.1.7.1.38 toString string () const nothrow
2.4.1.8 PosInfIntervalRange(TP)

A range over a PosInfInterval. It is an infinite range. PosInfIntervalRange is only ever constructed by PosInfInterval. However, when it is constructed, it is given a function, func, which is used to generate the time points which are iterated over. func takes a time point and returns a time point of the same type. So, for instance, if you had a PosInfInterval!Date, and you wanted to iterate over all of the days in that interval, you would pass a function to PosInfInterval's fwdRange where that function took a Date and returned a Date which was one day later. That function would then be used by PosInfIntervalRange's popFront to iterate over the Dates in the interval - though obviously, since the range is infinite, you would use a function such as std.range.take with it rather than iterating over all of the dates. As the interval goes to positive infinity, the range is always iterated over forwards, never backwards. func must generate a time point going in the proper direction of iteration, or a DateTimeException will be thrown. So, the time points that func generates must be later in time than the one passed to it. If it's either identical or earlier in time, then a DateTimeException will be thrown.

2.4.1.8.1 Functions
2.4.1.8.1.1 front TP () const pure nothrow
2.4.1.8.1.2 func TP delegate(in TP) () pure nothrow
2.4.1.8.1.3 interval PosInfInterval!TP () const pure nothrow
2.4.1.8.1.4 opAssign PosInfIntervalRange (ref PosInfIntervalRange rhs) pure nothrow
2.4.1.8.1.5 popFront void ()
2.4.1.8.1.6 save PosInfIntervalRange () pure nothrow
2.4.1.9 StopWatch

StopWatch measures time highly precise as possible. This class uses performance counter. On Windows, This uses QueryPerformanceCounter. For Posix, This uses clock_gettime if available, gettimeofday otherwise. But this has dispersion in accuracy by environment. It is impossible to remove this dispersion. This depends on multi task system for example overhead from change of the context switch of the thread.

2.4.1.9.1 Functions
2.4.1.9.1.1 this (AutoStart autostart)
2.4.1.9.1.2 peek @safe const Ticks ()
2.4.1.9.1.3 reset @safe void ()
2.4.1.9.1.4 start @safe void ()
2.4.1.9.1.5 stop @safe void ()
2.4.1.10 SysTime

SysTime is the type used when you want to get the current time from the system or if you're doing anything that involves time zones. Unlike DateTime, the time zone is an integral part of SysTime (though if all you care about is local time, you can pretty much ignore time zones, and it will work, since it defaults to using the local time zone). It holds its internal time in std time (hnsecs since midnight, January 1st, 1 A.D. UTC), so it interfaces well with the system time. However, that means that, unlike DateTime, it is not optimized for calendar-based operations, and getting individual units from it such as years or days is going to involve conversions and be less efficient. Basically, if you care about calendar-based operations and don't necessarily care about time zones, then DateTime would be the type to use. However, if what you care about is the system time, then SysTime would be the type to use.

2.4.1.10.1 Functions
2.4.1.10.1.1 this (in Date date, immutable TimeZone tz = null) nothrow
2.4.1.10.1.2 this (in DateTime dateTime, immutable TimeZone tz = null) nothrow
2.4.1.10.1.3 this (in DateTime dateTime, in FracSec fsec, immutable TimeZone tz = null) nothrow
2.4.1.10.1.4 this (long stdTime, immutable TimeZone tz = null) pure nothrow
2.4.1.10.1.5 add ref SysTime (string units)(long value, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) nothrow

if(units == "years" || units == "months")

2.4.1.10.1.6 day ubyte () const nothrow
2.4.1.10.1.7 day void (int day)
2.4.1.10.1.8 dayOfGregorianCal int () const nothrow
2.4.1.10.1.9 dayOfGregorianCal void (int days) nothrow
2.4.1.10.1.10 dayOfWeek DayOfWeek () const nothrow
2.4.1.10.1.11 dayOfYear ushort () const nothrow
2.4.1.10.1.12 dayOfYear void (int day)
2.4.1.10.1.13 diffMonths int (in SysTime rhs) const nothrow
2.4.1.10.1.14 dstInEffect bool () const nothrow
2.4.1.10.1.15 endOfMonth SysTime () const nothrow
2.4.1.10.1.16 endOfMonthDay ubyte () const nothrow
2.4.1.10.1.17 fracSec FracSec () const nothrow
2.4.1.10.1.18 fracSec void (FracSec fracSec) nothrow
2.4.1.10.1.19 fromISOExtendedString static SysTime (S)(in S isoExtString, immutable TimeZone tz = null)

if(isSomeString!(S))

2.4.1.10.1.20 fromISOString static SysTime (S)(in S isoString, immutable TimeZone tz = null)

if(isSomeString!S)

2.4.1.10.1.21 fromSimpleString static SysTime (S)(in S simpleString, immutable TimeZone tz = null)

if(isSomeString!(S))

2.4.1.10.1.22 hour ubyte () const nothrow
2.4.1.10.1.23 hour void (int hour)
2.4.1.10.1.24 isAD bool () const nothrow
2.4.1.10.1.25 isLeapYear bool () const nothrow
2.4.1.10.1.26 isoWeek ubyte () const nothrow
2.4.1.10.1.27 julianDay long () const nothrow
2.4.1.10.1.28 max static SysTime () pure nothrow
2.4.1.10.1.29 min static SysTime () pure nothrow
2.4.1.10.1.30 minute ubyte () const nothrow
2.4.1.10.1.31 minute void (int minute)
2.4.1.10.1.32 modJulianDay long () const nothrow
2.4.1.10.1.33 month Month () const nothrow
2.4.1.10.1.34 month void (Month month)
2.4.1.10.1.35 opAssign ref SysTime (const ref SysTime rhs) pure nothrow
2.4.1.10.1.36 opAssign ref SysTime (SysTime rhs) pure nothrow
2.4.1.10.1.37 opBinary Duration (string op)(in SysTime rhs) const pure nothrow

if(op == "-")

2.4.1.10.1.38 opBinary SysTime (string op, D)(in D duration) const pure nothrow

if((op == "+" || op == "-") && (is(Unqual!D == Duration) || is(Unqual!D == TickDuration)))

2.4.1.10.1.39 opCast Date (T)() const nothrow

if(is(Unqual!T == Date))

2.4.1.10.1.40 opCast DateTime (T)() const nothrow

if(is(Unqual!T == DateTime))

2.4.1.10.1.41 opCast SysTime (T)() const pure nothrow

if(is(Unqual!T == SysTime))

2.4.1.10.1.42 opCast TimeOfDay (T)() const nothrow

if(is(Unqual!T == TimeOfDay))

2.4.1.10.1.43 opCmp int (in SysTime rhs) const pure nothrow
2.4.1.10.1.44 opEquals bool (const ref SysTime rhs) const pure nothrow
2.4.1.10.1.45 opOpAssign SysTime (string op, D)(in D duration) pure nothrow

if((op == "+" || op == "-") && (is(Unqual!D == Duration) || is(Unqual!D == TickDuration)))

2.4.1.10.1.46 roll void (string units)(long value) nothrow

if(units == "days")

2.4.1.10.1.47 roll void (string units)(long value) nothrow

if(units == "hours" || units == "minutes" || units == "seconds")

2.4.1.10.1.48 roll void (string units)(long value) nothrow

if(units == "msecs" || units == "usecs" || units == "hnsecs")

2.4.1.10.1.49 roll void (string units)(long value, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) nothrow

if(units == "months")

2.4.1.10.1.50 roll void (string units)(long value, AllowDayOverflow allowOverflow = AllowDayOverflow.yes) nothrow

if(units == "years")

2.4.1.10.1.51 second ubyte () const nothrow
2.4.1.10.1.52 second void (int second)
2.4.1.10.1.53 stdTime long () const pure nothrow
2.4.1.10.1.54 stdTime void (long stdTime) pure nothrow
2.4.1.10.1.55 timezone immutable(TimeZone) () const pure nothrow
2.4.1.10.1.56 timezone void (immutable TimeZone timezone) pure nothrow
2.4.1.10.1.57 toISOExtendedString string () const nothrow
2.4.1.10.1.58 toISOString string () const nothrow
2.4.1.10.1.59 toLocalTime SysTime () const nothrow
2.4.1.10.1.60 toOtherTZ SysTime (immutable TimeZone tz) const pure nothrow
2.4.1.10.1.61 toSimpleString string () const nothrow
2.4.1.10.1.62 toString string ()
2.4.1.10.1.63 toString string () const nothrow
2.4.1.10.1.64 toTimeVal timeval () const pure nothrow
2.4.1.10.1.65 toTM tm () const nothrow
2.4.1.10.1.66 toUnixTime time_t () const pure nothrow
2.4.1.10.1.67 toUTC SysTime () const pure nothrow
2.4.1.10.1.68 year short () const nothrow
2.4.1.10.1.69 year void (int year)
2.4.1.10.1.70 yearBC ushort () const
2.4.1.10.1.71 yearBC void (int year)
2.4.1.11 Ticks

System clock time. This type maintains the most high precision ticks of system clock in each environment. (For StopWatch) Note: No longer part of std.datetime (or any other module)

2.4.1.11.1 Attributes
2.4.1.11.1.1 appOrigin Ticks static immutable
2.4.1.11.1.2 microseconds alias toMicroseconds!real
2.4.1.11.1.3 milliseconds alias toMilliseconds!real
2.4.1.11.1.4 msec alias toMilliseconds!long
2.4.1.11.1.5 sec alias toSeconds!long
2.4.1.11.1.6 seconds alias toSeconds!real
2.4.1.11.1.7 ticksPerSec long static immutable
2.4.1.11.1.8 usec alias toMicroseconds!long
2.4.1.11.1.9 value long
2.4.1.11.2 Functions
2.4.1.11.2.1 this shared static ()
2.4.1.11.2.2 fromMicroseconds static Ticks (long usec)
2.4.1.11.2.3 fromMilliseconds static Ticks (long msec)
2.4.1.11.2.4 fromSeconds static Ticks (T)(T sec)

if (isNumeric!T)

2.4.1.11.2.5 opBinary const real (string op)(Ticks x)

if (op == "-" || op == "+")

2.4.1.11.2.6 opBinary const Ticks (string op)(in Ticks t)

if ((op == "*" || op == "/") && isNumeric!(T))

2.4.1.11.2.7 opBinary Ticks (string op, T)(T x)

if (op == "/")

2.4.1.11.2.8 opCmp const int (ref const Ticks t)
2.4.1.11.2.9 opEquals const equals_t (ref const Ticks t)
2.4.1.11.2.10 opOpAssign void (string op)(in Ticks t)

if (op == "+" || op == "-")

2.4.1.11.2.11 opOpAssign void (string op, T)(T x)

if ((op == "*" || op == "/") && isNumeric!(T))

2.4.1.11.2.12 toMicroseconds const T (T)()

if (isFloatingPoint!T)

2.4.1.11.2.13 toMicroseconds const T (T)()

if (isIntegral!T && T.sizeof >= 4)

2.4.1.11.2.14 toMilliseconds const T (T)()

if (isFloatingPoint!T)

2.4.1.11.2.15 toMilliseconds const T (T)()

if (isIntegral!T && T.sizeof >= 4)

2.4.1.11.2.16 toSeconds const T (T)()

if (isFloatingPoint!T)

2.4.1.11.2.17 toSeconds const T (T)()

if (isIntegral!T && T.sizeof >= 4)

2.4.1.12 TimeOfDay

Represents a time of day with hours, minutes, and seconds. It uses 24 hour time.

2.4.1.12.1 Functions
2.4.1.12.1.1 this (int hour, int minute, int second = 0) pure
2.4.1.12.1.2 fromISOExtendedString static TimeOfDay (S)(in S isoExtString)

if(isSomeString!S)

2.4.1.12.1.3 fromISOString static TimeOfDay (S)(in S isoString)

if(isSomeString!S)

2.4.1.12.1.4 hour ubyte () const pure nothrow
2.4.1.12.1.5 hour void (int hour) pure
2.4.1.12.1.6 max static TimeOfDay () pure nothrow
2.4.1.12.1.7 min static TimeOfDay () pure nothrow
2.4.1.12.1.8 minute ubyte () const pure nothrow
2.4.1.12.1.9 minute void (int minute) pure
2.4.1.12.1.10 opBinary Duration (string op)(in TimeOfDay rhs) const pure nothrow

if(op == "-")

2.4.1.12.1.11 opBinary TimeOfDay (string op, D)(in D duration) const pure nothrow

if((op == "+" || op == "-") && (is(Unqual!D == Duration) || is(Unqual!D == TickDuration)))

2.4.1.12.1.12 opCmp int (in TimeOfDay rhs) const pure nothrow
2.4.1.12.1.13 opOpAssign TimeOfDay (string op, D)(in D duration) pure nothrow

if((op == "+" || op == "-") && (is(Unqual!D == Duration) || is(Unqual!D == TickDuration)))

2.4.1.12.1.14 roll void (string units)(long value) pure nothrow

if(units == "hours")

2.4.1.12.1.15 roll void (string units)(long value) pure nothrow

if(units == "minutes" || units == "seconds")

2.4.1.12.1.16 second ubyte () const pure nothrow
2.4.1.12.1.17 second void (int second) pure
2.4.1.12.1.18 toISOExtendedString string () const nothrow
2.4.1.12.1.19 toISOString string () const nothrow
2.4.1.12.1.20 toString string ()
2.4.1.12.1.21 toString string () const nothrow
2.4.2 Classes
2.4.2.1 Clock

Effectively a namespace to make it clear that the methods it contains are getting the time from the system clock. It cannot be instantiated.

2.4.2.1.1 Functions
2.4.2.1.1.1 currAppTick static TickDuration ()
2.4.2.1.1.2 currStdTime static long ()
2.4.2.1.1.3 currSystemTick static TickDuration ()
2.4.2.1.1.4 currTime static SysTime (immutable TimeZone tz = LocalTime())
2.4.2.2 TimeZone

Represents a timezone. It is used with SysTime to indicate the timezone of a SysTime.

2.4.2.2.1 Functions
2.4.2.2.1.1 dstInEffect abstract bool (long stdTime) const nothrow;

Takes the number of hnsecs (100 ns) since midnight, January 1st, 1 A.D. in UTC time (i.e. std time) and returns whether DST is effect in this time zone at the given point in time. Params: stdTime = The UTC time that needs to be checked for DST in this time zone.

2.4.2.2.1.2 dstName string () const nothrow

Typically, the abbreviation (generally 3 or 4 letters) for the time zone when DST is in effect (e.g. PDT). It is not necessarily unique. However, on Windows, it may be the unabbreviated name (e.g. Pacific Daylight Time). Regardless, it is not the same as name.

2.4.2.2.1.3 getInstalledTZNames static string[] (string subName = "")

Returns a list of the names of the time zones installed on the system. You can provide a sub-name to narrow down the list of time zones (which will likely be in the thousands if you get them all). For example, if you pass in "America" as the sub-name, then only the time zones which begin with "America" will be returned. On Windows, this function will convert the Windows time zone names to the corresponding TZ Database names with windowsTZNameToTZDatabaseName. If you want the actual Windows time zone names, use WindowsTimeZone.getInstalledTZNames directly. Params: subName = The first part of the time zones that you want. Throws: FileException on Posix systems if it fails to read from disk. DateTimeException on Windows systems if it fails to read the registry.

2.4.2.2.1.4 getTimeZone static immutable(TimeZone) (string name)

Returns a TimeZone with the give name per the TZ Database. This returns a PosixTimeZone on Posix systems and a WindowsTimeZone on Windows systems. If you want a PosixTimeZone on Windows, then call PosixTimeZone.getTimeZone directly and give it the location of the TZ Database time zone files on disk. On Windows, the given TZ Database name is converted to the corresponding time zone name on Windows prior to calling WindowsTimeZone.getTimeZone. So, this function allows you to use the same time zone names on both Windows and Posix systems. See_Also: en.wikipedia.org/wiki/Tz_database, Wikipedia entry on TZ Database en.wikipedia.org/wiki/List_of_tz_database_time_zones, List of Time Zones unicode.org/repos/cldr-tmp/trunk/diff/supplemental/zone_tzid.html, Windows <-> TZ Database Name Conversion Table Params: name = The TZ Database name of the time zone that you're looking for. Throws: $(D DateTimeException) if the given time zone could not be found. Examples: -------------------- auto tz = TimeZone.getTimeZone("America/Los_Angeles"); --------------------

2.4.2.2.1.5 hasDST abstract bool () const nothrow

Whether this time zone has Daylight Savings Time at any point in time. Note that for some time zone types it may not have DST for current dates but will still return true for hasDST because the time zone did at some point have DST.

2.4.2.2.1.6 name string () const nothrow

The name of the time zone per the TZ Database. This is the name used to get a TimeZone by name with TimeZone.getTimeZone. See_Also: en.wikipedia.org/wiki/Tz_database, Wikipedia entry on TZ Database en.wikipedia.org/wiki/List_of_tz_database_time_zones, List of Time Zones

2.4.2.2.1.7 stdName string () const nothrow

Typically, the abbreviation (generally 3 or 4 letters) for the time zone when DST is not in effect (e.g. PST). It is not necessarily unique. However, on Windows, it may be the unabbreviated name (e.g. Pacific Standard Time). Regardless, it is not the same as name.

2.4.2.2.1.8 tzToUTC abstract long (long adjTime) const nothrow

Takes the number of hnsecs (100 ns) since midnight, January 1st, 1 A.D. in this time zone's time and converts it to UTC (i.e. std time). Params: adjTime = The time in this time zone that needs to be adjusted to UTC time.

2.4.2.2.1.9 utcToTZ abstract long (long stdTime) const nothrow

Takes the number of hnsecs (100 ns) since midnight, January 1st, 1 A.D. in UTC time (i.e. std time) and converts it to this time zone's time. Params: stdTime = The UTC time that needs to be adjusted to this time zone's time.

2.4.2.3 LocalTime : TimeZone

A TimeZone which represents the current local time zone on the system running your program. This uses the underlying C calls to adjust the time rather than using specific D code based off of system settings to calculate the time such as PosixTimeZone and WindowsTimeZone do. That also means that it will use whatever the current time zone is on the system, even if the system's time zone changes while the program is running.

2.4.2.3.1 Functions
2.4.2.3.1.1 dstInEffect override bool (long stdTime) const nothrow
2.4.2.3.1.2 dstName override string () const nothrow
2.4.2.3.1.3 hasDST override bool () const nothrow
2.4.2.3.1.4 opCall static immutable(LocalTime) () pure nothrow
2.4.2.3.1.5 stdName override string () const nothrow
2.4.2.3.1.6 tzToUTC override long (long adjTime) const nothrow
2.4.2.3.1.7 utcToTZ override long (long stdTime) const nothrow
2.4.2.4 PosixTimeZone : TimeZone

Represents a time zone from a TZ Database time zone file. Files from the TZ database are how Posix systems hold their time zone information. Unfortunately, Windows does not use the TZ Database. You can, however, use PosixTimeZone (which reads its information from the TZ Database files on disk) on Windows if you provide the TZ Database files ( Repository with the TZ Database files (tzdata) ) yourself and tell PosixTimeZone.getTimeZone where the directory holding them is. TZ Database files hold DST transitions for a large interval of the time covered by time_t. So, barring errors in the information in the TZ Database files, it will use the correct DST rules for any date. Windows, on the other hand, maintains only the current DST rules, so historical dates will use the current DST rules (and therefore potentially be incorrect). So, if you want the DST rules that you use to be more accurate, or if you're looking for your program to act consistently on both Posix and Windows systems, then, as mentioned above, you'll need to include the TZ Database files with your program and give PosixTimeZone.getTimeZone the directory on disk where they are located. To get a PosixTimeZone, either call PosixTimeZone.getTimeZone (which will allow you to specify the location the time zone files) or call TimeZone.getTimeZone (which will give you a PosixTimeZone on Posix systems and a WindowsTimeZone on Windows systems). Note: Unless your system's local time zone deals with leap seconds (which is highly unlikely), then only way that you will get a time zone which takes leap seconds into account is if you use PosixTimeZone with a time zone whose name starts with "right/". Those time zone files do include leap seconds, and PosixTimeZone will take them into account (though posix systems which use a "right/" time zone as their local time zone will not take leap seconds into account even though they're in the file). See Also: Wikipedia entry on TZ Database List of Time Zones

2.4.2.4.1 Functions
2.4.2.4.1.1 dstInEffect override bool (long stdTime) const nothrow
2.4.2.4.1.2 getInstalledTZNames static string[] (string subName = "", string tzDatabaseDir = defaultTZDatabaseDir)
2.4.2.4.1.3 getTimeZone static immutable(PosixTimeZone) (string name, string tzDatabaseDir = defaultTZDatabaseDir)
2.4.2.4.1.4 hasDST override bool () const nothrow
2.4.2.4.1.5 tzToUTC override long (long adjTime) const nothrow
2.4.2.4.1.6 utcToTZ override long (long stdTime) const nothrow
2.4.2.5 SimpleTimeClass : TimeZone

Represents a time zone with an offset (in minutes, west is negative) from UTC but no DST. It's primarily used as the time zone in the result of SysTime's fromISOString, fromISOExtendedString, and fromSimpleString. name and dstName are always the empty string since this time zone has no DST, and while it may be meant to represent a time zone which is in the TZ Database, obviously it's not likely to be following the exact rules of any of the time zones in the TZ Database, so it makes no sense to set it.

2.4.2.5.1 Attributes
2.4.2.5.1.1 utcOffset int immutable

The number of minutes the offset from UTC is (negative is west of UTC, positive is east).

2.4.2.5.2 Functions
2.4.2.5.2.1 this (int utcOffset, string stdName = "") immutable
2.4.2.5.2.2 dstInEffect override bool (long stdTime) const nothrow
2.4.2.5.2.3 hasDST override bool () const nothrow
2.4.2.5.2.4 tzToUTC override long (long adjTime) const nothrow
2.4.2.5.2.5 utcToTZ override long (long stdTime) const nothrow
2.4.2.6 UTC : TimeZone

A TimeZone which represents UTC.

2.4.2.6.1 Functions
2.4.2.6.1.1 dstInEffect override bool (long stdTime) const nothrow
2.4.2.6.1.2 hasDST override bool () const nothrow
2.4.2.6.1.3 opCall static immutable(UTC) () pure nothrow
2.4.2.6.1.4 tzToUTC override long (long adjTime) const nothrow
2.4.2.6.1.5 utcToTZ override long (long stdTime) const nothrow
2.4.2.7 WindowsTimeZone : TimeZone

This class is Windows-Only. Represents a time zone from the Windows registry. Unfortunately, Windows does not use the TZ Database. You can, however, use PosixTimeZone (which reads its information from the TZ Database files on disk) on Windows if you provide the TZ Database files ( Repository with the TZ Database files (tzdata) ) yourself and tell PosixTimeZone.getTimeZone where the directory holding them is. TZ Database files hold DST transitions for a large interval of the time covered by time_t. So, barring errors in the information in the TZ Database files, it will use the correct DST rules for any date. Windows, on the other hand, maintains only the current DST rules, so historical dates will use the current DST rules (and therefore potentially be incorrect). So, if you want the DST rules that you use to be more accurate, or if you're looking for your program to act consistently on both Posix and Windows systems, then, as mentioned above, you'll need to include the TZ Database files with your program and give PosixTimeZone.getTimeZone the directory on disk where they are located. However, if all you care about is whether current times use the correct DST rules, or if you don't care whether the DST rules are historically accurate, then you can just use WindowsTimeZone on Windows. WindowsTimeZone does not exist on Posix systems. To get a WindowsTimeZone, either call WindowsTimeZone.getTimeZone or call TimeZone.getTimeZone (which will give you a PosixTimeZone on Posix systems and a WindowsTimeZone on Windows systems).

2.4.2.7.1 Functions
2.4.2.7.1.1 dstInEffect override bool (long stdTime) const nothrow
2.4.2.7.1.2 getInstalledTZNames static string[] ()
2.4.2.7.1.3 getTimeZone static immutable(WindowsTimeZone) (string name)
2.4.2.7.1.4 hasDST override bool () const nothrow
2.4.2.7.1.5 tzToUTC override long (long adjTime) const nothrow
2.4.2.7.1.6 utcToTZ override long (long stdTime) const nothrow
2.4.3 Attributes
2.4.3.1 AllowDayOverflow enum

enum AllowDayOverflow { /// No, don't allow day overflow. no, /// Yes, allow day overflow. yes } In some date calculations, adding months or years can cause the date to fall on a day of the month which is not valid (e.g. February 29th 2001 or June 31st 2000). If overflow is allowed (as is the default), then the month will be incremented accordingly (so, February 29th 2001 would become March 1st 2001, and June 31st 2000 would become July 1st 2000). If overflow is not allowed, then the day will be adjusted to the last valid day in that month (so, February 29th 2001 would become February 28th 2001 and June 31st 2000 would become June 30th 2000). AllowDayOverflow only applies to calculations involving months or years.

2.4.3.2 AutoStart enum

enum AutoStart { /// No, don't start the StopWatch when it is constructed. no, /// Yes, do start the StopWatch when it is constructed. yes } Used by StopWatch to indicate whether it should start immediately upon construction.

2.4.3.3 DayOfWeek enum : ubyte

enum DayOfWeek : ubyte { sun = 0, /// mon, /// tue, /// wed, /// thu, /// fri, /// sat /// }

2.4.3.4 Direction enum

enum Direction { /// Backward. bwd, /// Forward. fwd, /// Both backward and forward. both } Indicates a direction in time. One example of its use is Interval's expand function which uses it to indicate whether the interval should be expanded backwards (into the past), forwards (into the future), or both.

2.4.3.5 DosFileTime typedef uint
2.4.3.6 indexOf alias std.string.indexOf
2.4.3.7 Month enum : ubyte

enum Month : ubyte { jan = 1, /// feb, /// mar, /// apr, /// may, /// jun, /// jul, /// aug, /// sep, /// oct, /// nov, /// dec /// }

2.4.3.8 PopFirst enum

enum PopFirst { /// No, don't call popFront() before returning the range. no, /// Yes, call popFront() before returning the range. yes }

2.4.3.9 timeStrings string[] immutable

"hnsecs", 0 "usecs", 1 "msecs", 2 "seconds", 3 "minutes", 4 "hours", 5 "days", 6 "weeks", 7 "months", 8 "years" 9

2.4.4 Functions
2.4.4.1 abs D (D)(D duration)

if(is(Unqual!D == Duration) || is(Unqual!D == TickDuration))

2.4.4.2 cmpTimeUnits int (string lhs, string rhs)
2.4.4.3 daysToDayOfWeek static int (DayOfWeek currDoW, DayOfWeek dow) pure nothrow
2.4.4.4 DosFileTimeToSysTime SysTime (DosFileTime dft, immutable TimeZone tz = LocalTime())
2.4.4.5 dTimeToSysTime SysTime (long dTime, immutable TimeZone tz = null)
2.4.4.6 enforceValid void (string units)(int value, string file = __FILE__, size_t line = __LINE__) pure

if(units == "months" || units == "hours" || units == "minutes" || units == "seconds")

2.4.4.7 enforceValid void (string units)(int year, Month month, int day, string file = __FILE__, size_t line = __LINE__) pure

if(units == "days")

2.4.4.8 everyDayOfWeek static TP delegate(in TP) (TP, Direction dir = Direction.fwd)(DayOfWeek dayOfWeek) nothrow

if(isTimePoint!TP && (dir == Direction.fwd || dir == Direction.bwd) && __traits(hasMember, TP, "dayOfWeek") && !__traits(isStaticFunction, TP.dayOfWeek) && is(ReturnType!(TP.dayOfWeek) == DayOfWeek) && (functionAttributes!(TP.dayOfWeek) & FunctionAttribute.PROPERTY) && (functionAttributes!(TP.dayOfWeek) & FunctionAttribute.NOTHROW)) Range-generating function. Returns a delegate which returns the next time point with the given DayOfWeek in a range. Using this delegate allows you to iterate over successive time points which are all the same day of the week. e.g. passing DayOfWeek.mon to everyDayOfWeek would result in a delegate which could be used to iterate over all of the Mondays in a range. Parameters: dir The direction to iterate in. If passing the return value to fwdRange, use Direction.fwd. If passing it to bwdRange, use Direction.bwd. dayOfWeek The week that each time point in the range will be. Examples: auto interval = Interval!Date(Date(2010, 9, 2), Date(2010, 9, 27)); auto func = everyDayOfWeek!Date(DayOfWeek.mon); auto range = interval.fwdRange(func);

2.4.4.9 everyDuration static TP delegate(in TP) (TP, Direction dir = Direction.fwd, D)(D duration) nothrow

if(isTimePoint!TP && __traits(compiles, TP.init + duration) && (dir == Direction.fwd || dir == Direction.bwd)) Range-generating function. Returns a delegate which returns the next time point which is the given duration later. Using this delegate allows you to iterate over successive time points which are apart by the given duration e.g. passing dur!"days"(3) to everyDuration would result in a delegate which could be used to iterate over a range of days which are each 3 days apart. Parameters: dir The direction to iterate in. If passing the return value to fwdRange, use Direction.fwd. If passing it to bwdRange, use Direction.bwd. duration The duration which separates each successive time point in the range. Examples: auto interval = Interval!Date(Date(2010, 9, 2), Date(2010, 9, 27)); auto func = everyDuration!Date(dur!"days"(8)); auto range = interval.fwdRange(func);

2.4.4.10 everyDuration static TP delegate(in TP) (TP, Direction dir = Direction.fwd, D)(int years, int months = 0, AllowDayOverflow allowOverflow = AllowDayOverflow.yes, D duration = dur!"days"(0)) nothrow

if(isTimePoint!TP && __traits(compiles, TP.init + duration) && __traits(compiles, TP.init.add!"years"(years)) && __traits(compiles, TP.init.add!"months"(months)) && (dir == Direction.fwd || dir == Direction.bwd)) Range-generating function. Returns a delegate which returns the next time point which is the given number of years, month, and duration later. The difference between this version of everyDuration and the version which just takes a Duration is that this one also takes the number of years and months (along with an AllowDayOverflow to indicate whether adding years and months should allow the days to overflow). Note that if iterating forward, add!"years"() is called on the given time point, then add!"months"(), and finally the duration is added to it. However, if iterating backwards, the duration is added first, then add!"months"() is called, and finally add!"years"() is called. That way, going backwards generates close to the same time points that iterating forward does, but since adding years and months is not entirely reversible (due to possible day overflow, regardless of whether AllowDayOverflow.yes or AllowDayOverflow.no is used), it can't be guaranteed that iterating backwards will give you the same time points as iterating forward would have (even assuming that the end of the range is a time point which would be returned by the delegate when iterating forward from begin). Parameters: dir The direction to iterate in. If passing the return value to fwdRange, use Direction.fwd. If passing it to bwdRange, use Direction.bwd. years The number of years to add to the time point passed to the delegate. months The number of months to add to the time point passed to the delegate. allowOverflow Whether the days should be allowed to overflow on begin and end, causing their month to increment. duration The duration to add to the time point passed to the delegate. Examples: auto interval = Interval!Date(Date(2010, 9, 2), Date(2025, 9, 27)); auto func = everyDuration!Date(4, 1, AllowDayOverflow.yes, dur!"days"(2)); auto range = interval.fwdRange(func);

2.4.4.11 everyMonth static TP delegate(in TP) (TP, Direction dir = Direction.fwd)(int month)

if(isTimePoint!TP && (dir == Direction.fwd || dir == Direction.bwd) && __traits(hasMember, TP, "month") && !__traits(isStaticFunction, TP.month) && is(ReturnType!(TP.month) == Month) && (functionAttributes!(TP.month) & FunctionAttribute.PROPERTY) && (functionAttributes!(TP.month) & FunctionAttribute.NOTHROW)) Range-generating function. Returns a delegate which returns the next time point with the given month which would be reached by adding months to the given time point. So, using this delegate allows you to iterate over successive time points which are in the same month but different years. For example, you could iterate over each successive December 25th in an interval by starting with a date which had the 25th as its day and passed Month.dec to everyMonth to create the delegate. Since it wouldn't really make sense to be iterating over a specific month and end up with some of the time points in the succeeding month or two years after the previous time point, AllowDayOverflow.no is always used when calculating the next time point. Parameters: dir The direction to iterate in. If passing the return value to fwdRange, use Direction.fwd. If passing it to bwdRange, use Direction.bwd. month The month that each time point in the range will be in. Examples: auto interval = Interval!Date(Date(2000, 1, 30), Date(2004, 8, 5)); auto func = everyMonth!(Date)(Month.feb); auto range = interval.fwdRange(func);

2.4.4.12 lengthof size_t (aliases...)() pure nothrow
2.4.4.13 monthsToMonth static int (int currMonth, int month) pure
2.4.4.14 stdTimeToUnixTime time_t (long stdTime) pure nothrow
2.4.4.15 SysTimeToDosFileTime DosFileTime (SysTime sysTime)
2.4.4.16 sysTimeToDTime long (in SysTime sysTime)
2.4.4.17 tzDatabaseNameToWindowsTZName string (string tzName)
2.4.4.18 unixTimeToStdTime long (time_t unixTime) pure nothrow
2.4.4.19 valid bool (string units)(int value) pure nothrow

if(units == "months" || units == "hours" || units == "minutes" || units == "seconds")

2.4.4.20 valid bool (string units)(int year, int month, int day) pure nothrow

if(units == "days")

2.4.4.21 validTimeUnits bool (string[] units...)
2.4.4.22 windowsTZNameToTZDatabaseName string (string tzName)
2.4.4.23 yearIsLeapYear static bool (int year) pure nothrow
2.5 std.file

Utilities for manipulating files and scanning directories. Functions in this module handle files as a unit, e.g., read or write one file at a time. For opening files and manipulating them via handles refer to module std.stdio. Authors: Walter Bright, Andrei Alexandrescu

2.5.1 Structs
2.5.1.1 DirEntry
2.5.1.1.1 Attributes
2.5.1.1.1.1 attributes uint
2.5.1.1.1.2 creationTime d_time
2.5.1.1.1.3 lastAccessTime d_time
2.5.1.1.1.4 lastWriteTime d_time
2.5.1.1.1.5 name string
2.5.1.1.1.6 size ulong
2.5.1.1.2 Functions
2.5.1.1.2.1 init void (in char[] path, in WIN32_FIND_DATA *fd)
2.5.1.1.2.2 init void (in char[] path, in WIN32_FIND_DATAW *fd)
2.5.1.1.2.3 isdir bool () const
2.5.1.1.2.4 isfile bool () const
2.5.1.2 DirIterator
2.5.1.2.1 Attributes
2.5.1.2.1.1 pathname string
2.5.1.2.1.2 mode SpanMode
2.5.1.2.2 Functions
2.5.1.2.2.1 opApply int (D)(scope D dg)
2.5.2 Classes
2.5.2.1 FileException : Exception
2.5.3 Attributes
2.5.3.1 SpanMode enum
2.5.4 Functions
2.5.4.1 append void (in char[] name, in void[] buffer)
2.5.4.2 chdir void (in char[] pathname)
2.5.4.3 copy void (in char[] from, in char[] to)
2.5.4.4 dirEntries DirIterator (string path, SpanMode mode)
2.5.4.5 exists bool (in char[] name)
2.5.4.6 getAttributes uint (in char[] name)
2.5.4.7 getcwd string ()
2.5.4.8 getSize ulong (in char[] name)
2.5.4.9 getTimes void (in char[] name, out d_time ftc, out d_time fta, out d_time ftm)
2.5.4.10 isdir bool (in char[] name)
2.5.4.11 isfile bool (in char[] name)
2.5.4.12 lastModified d_time (in char[] name, d_time returnIfMissing)
2.5.4.13 listdir string[] (in char[] pathname)
2.5.4.14 listdir string[] (in char[] pathname, in char[] pattern)
2.5.4.15 listdir string[] (in char[] pathname, RegExp r)
2.5.4.16 listdir void (in char[] pathname, bool delegate(DirEntry* de) callback)
2.5.4.17 listdir void (in char[] pathname, bool delegate(string filename) callback)
2.5.4.18 mkdir void (in char[] pathname)
2.5.4.19 mkdirRecurse void (in char[] pathname)
2.5.4.20 read void[] (in char[] name, size_t upTo = size_t.max)
2.5.4.21 readText S (S = string)(in char[] name)
2.5.4.22 remove void (in char[] name)
2.5.4.23 rename void (in char[] from, in char[] to)
2.5.4.24 rmdir void (in char[] pathname)
2.5.4.25 rmdirRecurse void (in char[] pathname)
2.5.4.26 setTimes void (in char[] name, d_time fta, d_time ftm)
2.5.4.27 write void (in char[] name, const void[] buffer)
2.6 std.math

Elementary mathematical functions Contains the elementary mathematical functions (powers, roots, and trignometric functions), and low-level floating-point operations. Mathematical special functions are available in std.mathspecial. The functionality closely follows the IEEE754-2008 standard for floating-point arithmetic, including the use of camelCase names rather than C99-style lower case names. All of these functions behave correctly when presented with an infinity or NaN. Unlike C, there is no global 'errno' variable. Consequently, almost all of these functions are pure nothrow. Status: The gamma and error functions have been superceded by improved versions in std.mathspecial. They will be officially deprecated in std.math in DMD2.055. The semantics and names of feqrel and approxEqual will be revised. Authors: Walter Bright, Don Clugston

2.6.1 Structs
2.6.1.1 IeeeFlags

IEEE exception status flags ('sticky bits') These flags indicate that an exceptional floating-point condition has occurred. They indicate that a NaN or an infinity has been generated, that a result is inexact, or that a signalling NaN has been encountered. If floating-point exceptions are enabled (unmasked), a hardware exception will be generated instead of setting these flags.

2.6.1.1.1 Attributes
2.6.1.1.1.1 flags uint
2.6.1.1.2 Functions
2.6.1.1.2.1 divByZero bool ()
2.6.1.1.2.2 inexact bool ()
2.6.1.1.2.3 invalid bool ()
2.6.1.1.2.4 overflow bool ()
2.6.1.1.2.5 underflow bool ()
2.6.1.2 FloatingPointControl

Control the Floating point hardware Change the IEEE754 floating-point rounding mode and the floating-point hardware exceptions. By default, the rounding mode is roundToNearest and all hardware exceptions are disabled. For most applications, debugging is easier if the division by zero, overflow, and invalid operation exceptions are enabled. These three are combined into a severeExceptions value for convenience. Note in particular that if invalidException is enabled, a hardware trap will be generated whenever an uninitialized floating-point variable is used. All changes are temporary. The previous state is restored at the end of the scope.

2.6.1.2.1 Attributes
2.6.1.2.1.1 EXCEPTION_MASK ushort
2.6.1.2.1.2 initialize bool
2.6.1.2.1.3 ROUNDING_MASK ushort
2.6.1.2.1.4 RoundingMode alias uint
2.6.1.2.1.5 savedState ushort
2.6.1.2.2 Functions
2.6.1.2.2.1 disableExceptions void (uint exceptions)
2.6.1.2.2.2 enabledExceptions static uint ()
2.6.1.2.2.3 enableExceptions void (uint exceptions)
2.6.1.2.2.4 rounding static RoundingMode ()
2.6.1.2.2.5 rounding void (RoundingMode newMode)
2.6.2 Attributes
2.6.2.1 isnan alias isNaN
2.6.2.2 isfinite alias isFinite
2.6.2.3 isnormal alias isNormal
2.6.2.4 issubnormal alias isSubnormal
2.6.2.5 isinf alias isInfinity
2.6.2.6 E real
2.6.2.7 LOG2T real
2.6.2.8 LOG2E real
2.6.2.9 LOG2 real
2.6.2.10 LOG10E real
2.6.2.11 LN2 real
2.6.2.12 LN10 real
2.6.2.13 PI real
2.6.2.14 PI_2 real
2.6.2.15 PI_4 real
2.6.2.16 M_1_PI real
2.6.2.17 M_2_PI real
2.6.2.18 M_2_SQRTPI real
2.6.2.19 SQRT2 real
2.6.2.20 SQRT1_2 real
2.6.3 Functions
2.6.3.1 abs auto (Num)(Num z) @safe pure nothrow
2.6.3.2 abs Num (Num)(Num x) @safe pure nothrow
2.6.3.3 abs real (Num)(Num y) @safe pure nothrow
2.6.3.4 acos double (double x) @safe pure nothrow
2.6.3.5 acos float (float x) @safe pure nothrow
2.6.3.6 acos real (real x) @safe pure nothrow
2.6.3.7 acosh double (double x) @safe pure nothrow
2.6.3.8 acosh float (float x) @safe pure nothrow
2.6.3.9 acosh real (real x) @safe pure nothrow
2.6.3.10 approxEqual bool (T, U)(T lhs, U rhs)
2.6.3.11 approxEqual bool (T, U, V)(T lhs, U rhs, V maxRelDiff, V maxAbsDiff = 1e-5)
2.6.3.12 asin double (double x) @safe pure nothrow
2.6.3.13 asin float (float x) @safe pure nothrow
2.6.3.14 asin real (real x) @safe pure nothrow
2.6.3.15 asinh double (double x) @safe pure nothrow
2.6.3.16 asinh float (float x) @safe pure nothrow
2.6.3.17 asinh real (real x) @safe pure nothrow
2.6.3.18 atan double (double x) @safe pure nothrow
2.6.3.19 atan float (float x) @safe pure nothrow
2.6.3.20 atan real (real x) @safe pure nothrow
2.6.3.21 atan2 double (double y, double x) @safe pure nothrow
2.6.3.22 atan2 float (float y, float x) @safe pure nothrow
2.6.3.23 atan2 real (real y, real x) @trusted pure nothrow
2.6.3.24 atanh double (double x) @safe pure nothrow
2.6.3.25 atanh float (float x) @safe pure nothrow
2.6.3.26 atanh real (real x) @safe pure nothrow
2.6.3.27 cbrt real (real x) @trusted nothrow
2.6.3.28 ceil real (real x) @trusted nothrow
2.6.3.29 conj creal (creal z) @safe pure nothrow
2.6.3.30 conj ireal (ireal y) @safe pure nothrow
2.6.3.31 copysign real (real to, real from) @trusted pure nothrow
2.6.3.32 cos creal (creal z) @safe pure nothrow
2.6.3.33 cos real (ireal y) @safe pure nothrow
2.6.3.34 cos real (real x) @safe pure nothrow;
2.6.3.35 cosh double (double x) @safe pure nothrow
2.6.3.36 cosh float (float x) @safe pure nothrow
2.6.3.37 cosh real (real x) @safe pure nothrow
2.6.3.38 erf real (real x) @trusted nothrow
2.6.3.39 erfc real (real x) @trusted nothrow
2.6.3.40 exp double (double x) @safe pure nothrow
2.6.3.41 exp float (float x) @safe pure nothrow
2.6.3.42 exp real (real x) @safe pure nothrow
2.6.3.43 exp2 real (real x) @trusted pure nothrow
2.6.3.44 expi creal (real y) @trusted pure nothrow
2.6.3.45 expm1 real (real x) @trusted pure nothrow
2.6.3.46 fabs real (real x) @safe pure nothrow;
2.6.3.47 fdim real (real x, real y) @safe pure nothrow
2.6.3.48 feqrel int (X)(X x, X y) @trusted pure nothrow
2.6.3.49 floor real (real x) @trusted nothrow
2.6.3.50 fma real (real x, real y, real z) @safe pure nothrow
2.6.3.51 fmax real (real x, real y) @safe pure nothrow
2.6.3.52 fmin real (real x, real y) @safe pure nothrow
2.6.3.53 frexp real (real value, out int exp) @trusted pure nothrow
2.6.3.54 getNaNPayload ulong (real x) @trusted pure nothrow
2.6.3.55 hypot real (real x, real y) @safe pure nothrow
2.6.3.56 ieeeFlags IeeeFlags ()
2.6.3.57 ieeeMean T (T)(T x, T y) @trusted pure nothrow
2.6.3.58 ilogb int (real x) @trusted nothrow
2.6.3.59 isFinite int (real e) @trusted pure nothrow
2.6.3.60 isIdentical bool (real x, real y) @trusted pure nothrow
2.6.3.61 isInfinity bool (real x) @trusted pure nothrow
2.6.3.62 isNaN bool (real x) @trusted pure nothrow
2.6.3.63 isNormal int (X)(X x) @trusted pure nothrow
2.6.3.64 isSubnormal int (double d) @trusted pure nothrow
2.6.3.65 isSubnormal int (float f) @trusted pure nothrow
2.6.3.66 isSubnormal int (real x) @trusted pure nothrow
2.6.3.67 ldexp real (real n, int exp) @safe pure nothrow;
2.6.3.68 lgamma real (real x) @trusted nothrow
2.6.3.69 log real (real x) @safe pure nothrow
2.6.3.70 log10 real (real x) @safe pure nothrow
2.6.3.71 log1p real (real x) @safe pure nothrow
2.6.3.72 log2 real (real x) @safe pure nothrow
2.6.3.73 logb real (real x) @trusted nothrow
2.6.3.74 lrint long (real x) @trusted pure nothrow
2.6.3.75 lround long (real x) @trusted nothrow
2.6.3.76 modf real (real x, ref real y) @trusted nothrow
2.6.3.77 NaN real (ulong payload) @trusted pure nothrow
2.6.3.78 nearbyint real (real x) @trusted nothrow
2.6.3.79 nextafter T (T)(T x, T y) @safe pure nothrow
2.6.3.80 nextDown double (double x) @safe pure nothrow
2.6.3.81 nextDown float (float x) @safe pure nothrow
2.6.3.82 nextDown real (real x) @safe pure nothrow
2.6.3.83 nextUp double (double x) @trusted pure nothrow
2.6.3.84 nextUp float (float x) @trusted pure nothrow
2.6.3.85 nextUp real (real x) @trusted pure nothrow
2.6.3.86 poly real (real x, const real[] A) @trusted pure nothrow
2.6.3.87 pow real (I, F)(I x, F y) @trusted pure nothrow
2.6.3.88 pow typeof(Unqual!(F).init * Unqual!(G).init) (F, G)(F x, G n) @trusted pure nothrow
2.6.3.89 pow Unqual!(Largest!(F, G)) (F, G)(F x, G y) @trusted pure nothrow
2.6.3.90 pow Unqual!F (F, G)(F x, G n) @trusted pure nothrow
2.6.3.91 remainder real (real x, real y) @trusted nothrow
2.6.3.92 remquo real (real x, real y, out int n) @trusted nothrow
2.6.3.93 resetIeeeFlags void ()
2.6.3.94 rint real (real x) @safe pure nothrow;
2.6.3.95 rndtol long (real x) @safe pure nothrow;
2.6.3.96 round real (real x) @trusted nothrow
2.6.3.97 scalbn real (real x, int n) @trusted nothrow
2.6.3.98 sgn F (F)(F x) @safe pure nothrow
2.6.3.99 signbit int (real x) @trusted pure nothrow
2.6.3.100 sin creal (creal z) @safe pure nothrow
2.6.3.101 sin ireal (ireal y) @safe pure nothrow
2.6.3.102 sin real (real x) @safe pure nothrow;
2.6.3.103 sinh double (double x) @safe pure nothrow
2.6.3.104 sinh float (float x) @safe pure nothrow
2.6.3.105 sinh real (real x) @safe pure nothrow
2.6.3.106 sqrt creal (creal z) @safe pure nothrow
2.6.3.107 tan real (real x) @trusted pure nothrow
2.6.3.108 tanh double (double x) @safe pure nothrow
2.6.3.109 tanh float (float x) @safe pure nothrow
2.6.3.110 tanh real (real x) @safe pure nothrow
2.6.3.111 tgamma real (real x) @trusted nothrow
2.6.3.112 trunc real (real x) @trusted nothrow
2.6.3.113 yl2x real (real x, real y) @safe pure nothrow;
2.6.3.114 yl2xp1 real (real x, real y) @safe pure nothrow;
2.7 std.path

This module is used to parse file names. All the operations work only on strings; they don't perform any input/output operations. This means that if a path contains a directory name with a dot, functions like getExt() will work with it just as if it was a file. To differentiate these cases, use the std.file module first (i.e. std.file.isDir()). Authors: Walter Bright, Grzegorz Adam Hankiewicz, Thomas Kühne, Bill Baxter, Andrei Alexandrescu

2.7.1 Attributes
2.7.1.1 altsep string
2.7.1.2 curdir string
2.7.1.3 linesep string
2.7.1.4 pardir string
2.7.1.5 pathsep string
2.7.1.6 sep string
2.7.2 Functions
2.7.2.1 addExt string (string filename, string ext)
2.7.2.2 basename Char[] (Char, ExtChar = immutable(char))(Char[] fullname, ExtChar[] extension = null)
2.7.2.3 defaultExt string (string filename, string ext)
2.7.2.4 dirname Char[] (Char)(Char[] fullname)
2.7.2.5 expandTilde string (string inputPath)
2.7.2.6 fncharmatch bool (dchar c1, dchar c2)
2.7.2.7 fnmatch bool (const(char)[] filename, const(char)[] pattern)
2.7.2.8 getDrive Char[] (Char)(Char[] fullname)
2.7.2.9 getExt string (string fullname)
2.7.2.10 getName string (string fullname)
2.7.2.11 isabs bool (in char[] path)
2.7.2.12 join string (const(char)[] p1, const(char)[] p2, const(char)[][] more...)
2.7.2.13 rel2abs string (string path)
2.8 std.random

Facilities for random number generation. The old-style functions rand_seed and rand will soon be deprecated as they rely on global state and as such are subjected to various thread-related issues. The new-style generator objects hold their own state so they are immune of threading issues. The generators feature a number of well-known and well-documented methods of generating random numbers. An overall fast and reliable means to generate random numbers is the Mt19937 generator, which derives its name from "Mersenne Twister with a period of 2 to the power of 19937". In memory-constrained situations, linear congruential generators such as MinstdRand0 and MinstdRand might be useful. The standard library provides an alias Random for whichever generator it considers the most fit for the target environment. Authors: Andrei Alexandrescu

2.8.1 Structs
2.8.1.1 LinearCongruentialEngine
2.8.1.1.1 Attributes
2.8.1.1.1.1 empty bool
2.8.1.1.1.2 hasFixedRange bool
2.8.1.1.1.3 increment UIntType
2.8.1.1.1.4 max UIntType
2.8.1.1.1.5 min UIntType
2.8.1.1.1.6 modulus UIntType
2.8.1.1.1.7 multiplier UIntType
2.8.1.1.2 Functions
2.8.1.1.2.1 this (UIntType x0)
2.8.1.1.2.2 front UIntType ()
2.8.1.1.2.3 opEquals bool (ref const LinearCongruentialEngine rhs) const
2.8.1.1.2.4 popFront void ()
2.8.1.1.2.5 save typeof(this) ()
2.8.1.1.2.6 seed void (UIntType x0 = 1)
2.8.1.2 MersenneTwisterEngine
2.8.1.2.1 Attributes
2.8.1.2.1.1 _y UIntType
2.8.1.2.1.2 defaultSeed UIntType
2.8.1.2.1.3 empty bool
2.8.1.2.1.4 maskBits size_t
2.8.1.2.1.5 max UIntType
2.8.1.2.1.6 min UIntType
2.8.1.2.1.7 shiftSize size_t
2.8.1.2.1.8 stateSize size_t
2.8.1.2.1.9 temperingB UIntType
2.8.1.2.1.10 temperingC UIntType
2.8.1.2.1.11 temperingL size_t
2.8.1.2.1.12 temperingS size_t
2.8.1.2.1.13 temperingT size_t
2.8.1.2.1.14 temperingU UIntType
2.8.1.2.1.15 wordSize size_t
2.8.1.2.1.16 xorMask UIntType
2.8.1.2.2 Functions
2.8.1.2.2.1 this (UIntType value)
2.8.1.2.2.2 front UIntType ()
2.8.1.2.2.3 popFront void ()
2.8.1.2.2.4 save typeof(this) ()
2.8.1.2.2.5 seed void (UIntType value = defaultSeed)
2.8.1.3 RandomCover
2.8.1.3.1 Functions
2.8.1.3.1.1 this (Range input, Random rnd)
2.8.1.3.1.2 empty bool ()
2.8.1.3.1.3 front auto ref ()
2.8.1.3.1.4 length size_t ()
2.8.1.3.1.5 popFront void ()
2.8.1.3.1.6 save typeof(this) ()
2.8.1.4 RandomSample
2.8.1.4.1 Functions
2.8.1.4.1.1 this (R input, size_t howMany)
2.8.1.4.1.2 this (R input, size_t howMany, size_t total)
2.8.1.4.1.3 empty bool () const
2.8.1.4.1.4 index size_t ()
2.8.1.4.1.5 length size_t ()
2.8.1.4.1.6 popFront void ()
2.8.1.4.1.7 save typeof(this) ()
2.8.2 Attributes
2.8.2.1 Random alias Mt19937
2.8.2.2 MinstdRand0 alias LinearCongruentialEngine!(uint, 16807, 0, 2147483647)
2.8.2.3 MinstdRand alias LinearCongruentialEngine!(uint, 48271, 0, 2147483647)
2.8.2.4 Mt19937 alias MersenneTwisterEngine!(uint, 32, 624, 397, 31, 0x9908b0df, 11, 7, 0x9d2c5680, 15, 0xefc60000, 18)
2.8.3 Functions
2.8.3.1 dice size_t (Num)(Num[] proportions...)
2.8.3.2 dice size_t (R, Num)(ref R rnd, Num[] proportions...)
2.8.3.3 dice size_t (R, Range)(ref R rnd, Range proportions)
2.8.3.4 dice size_t (Range)(Range proportions)
2.8.3.5 rand_seed void (uint seed, uint index)

The random number generator is seeded at program startup with a random value. This ensures that each program generates a different sequence of random numbers. To generate a repeatable sequence, use rand_seed() to start the sequence. seed and index start it, and each successive value increments index. This means that the nth random number of the sequence can be directly generated by passing index + n to rand_seed(). Note: This is more random, but slower, than C's rand() function. To use C's rand() instead, import std.c.stdlib. BUGS: Shares a global single state, not multithreaded. SCHEDULED FOR DEPRECATION.

2.8.3.6 randomSample RandomSample!R (R)(R r, size_t n)

Selects a random subsample out of r, containing exactly n elements. The order of elements is the same as in the original range. The total length of r must be known. If total is passed in, the total number of sample is considered to be total. Otherwise, RandomSample uses r.length. If the number of elements is not exactly total, RandomSample throws an exception. This is because total is essential to computing the probability of selecting elements in the range. int[] a = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ]; // Print 5 random elements picked off from r foreach (e; randomSample(n, 5)) { writeln(e); }

2.8.3.7 randomSample RandomSample!R (R)(R r, size_t n, size_t total)

Selects a random subsample out of r, containing exactly n elements. The order of elements is the same as in the original range. The total length of r must be known. If total is passed in, the total number of sample is considered to be total. Otherwise, RandomSample uses r.length. If the number of elements is not exactly total, RandomSample throws an exception. This is because total is essential to computing the probability of selecting elements in the range.

2.8.3.8 randomShuffle void (Range, RandomGen = Random)(Range r, ref RandomGen gen = rndGen)
2.8.3.9 rndGen ref Random ()
2.8.3.10 uniform CommonType!(T1, T2) (string boundaries = "[)", T1, T2)(T1 a, T2 b)
2.8.3.11 uniform CommonType!(T1, T2) (string boundaries = "[)", T1, T2, UniformRandomNumberGenerator)(T1 a, T2 b, ref UniformRandomNumberGenerator urng)
2.8.3.12 uniformDistribution F[] (F = double)(size_t n, F[] useThis = null)
2.8.3.13 unpredictableSeed uint ()
2.9 std.regex

Regular expressions are a powerful method of string pattern matching. The regular expression language used in this library is the same as that commonly used, however, some of the very advanced forms may behave slightly differently. The standard observed is the ECMA standard for regular expressions. std.regex is designed to work only with valid UTF strings as input - UTF8 (char), UTF16 (wchar), or UTF32 (dchar). To validate untrusted input, use std.utf.validate(). Authors: Walter Bright, Andrei Alexandrescu

2.9.1 Structs
2.9.1.1 Regex(E)

struct Regex(E) if (is(E == Unqual!E))

2.9.1.1.1 Structs
2.9.1.1.1.1 Range
2.9.1.1.1.1.1 Attributes
2.9.1.1.1.1.1.1 base ubyte*
2.9.1.1.1.1.1.2 bits BitArray
2.9.1.1.1.1.1.3 buf OutBuffer
2.9.1.1.1.1.1.4 maxb uint
2.9.1.1.1.1.1.5 maxc uint
2.9.1.1.1.1.2 Functions
2.9.1.1.1.1.2.1 this (OutBuffer buf)
2.9.1.1.1.1.2.2 setbit2 void (uint u)
2.9.1.1.1.1.2.3 setbitmax void (uint u)
2.9.1.1.2 Functions
2.9.1.1.2.1 this (String)(String pattern, string attributes = null)
2.9.1.1.2.2 captures uint () const
2.9.1.1.2.3 compile public void (String)(String pattern, string attributes)
2.9.1.1.2.4 error void (string msg)
2.9.1.1.2.5 optimize void (OutBuffer buf)
2.9.1.1.2.6 parseAtom int (String)(in String pattern, ref size_t p, OutBuffer buf)
2.9.1.1.2.7 parsePiece int (String)(in String pattern, ref size_t p, OutBuffer buf)
2.9.1.1.2.8 parseRange int (String)(in String pattern, ref size_t p, OutBuffer buf)
2.9.1.1.2.9 parseRegex int (String)(in String pattern, ref size_t p, OutBuffer buf)
2.9.1.1.2.10 printProgram void (const(ubyte)[] prog = null)
2.9.1.1.2.11 regex Regex!(Unqual!(typeof(String.init[0]))) (String)(String pattern, string flags = null)
2.9.1.1.2.12 starrchars bool (ref Range r, const(ubyte)[] prog)
2.9.1.2 RegexMatch(Range = string)

The type returned by a call to match. It stores the matching state and can be inspected and iterated.

2.9.1.2.1 Structs
2.9.1.2.1.1 Captures
2.9.1.2.1.1.1 Functions
2.9.1.2.1.1.1.1 empty bool ()
2.9.1.2.1.1.1.2 front Range ()
2.9.1.2.1.1.1.3 length size_t ()
2.9.1.2.1.1.1.4 opIndex Range (size_t n)
2.9.1.2.1.1.1.5 opSlice ref auto ()
2.9.1.2.1.1.1.6 popFront void ()
2.9.1.2.1.1.1.7 save typeof(this) ()
2.9.1.2.2 Attributes
2.9.1.2.2.1 E alias typeof(Range.init[0])
2.9.1.2.2.2 engine Regex
2.9.1.2.2.3 input Range
2.9.1.2.2.4 pmatch regmatch_t[]
2.9.1.2.2.5 Regex alias .Regex!(Unqual!E)
2.9.1.2.2.6 src size_t
2.9.1.2.2.7 src_start size_t
2.9.1.2.3 Functions
2.9.1.2.3.1 this (this)
2.9.1.2.3.2 captures Captures ()
2.9.1.2.3.3 empty bool () const
2.9.1.2.3.4 front RegexMatch!(Range) ()
2.9.1.2.3.5 hit Range ()
2.9.1.2.3.6 popFront void ()
2.9.1.2.3.7 post Range ()
2.9.1.2.3.8 pre Range ()
2.9.1.2.3.9 save typeof(this) ()
2.9.1.2.3.10 toString string ()
2.9.1.3 Splitter(Range)

Range that splits another range using a regular expression as a separator.

2.9.1.3.1 Attributes
2.9.1.3.1.1 _input Range
2.9.1.3.1.2 _offset size_t
2.9.1.3.1.3 _match RegexMatch!(Range)
2.9.1.3.1.4 Rx alias Regex!(Unqual!(typeof(Range.init[0])))
2.9.1.3.2 Functions
2.9.1.3.2.1 this (Range input, Rx separator)
2.9.1.3.2.2 empty bool ()
2.9.1.3.2.3 front Range ()
2.9.1.3.2.4 opSlice ref auto ()
2.9.1.3.2.5 popFront void ()
2.9.1.3.2.6 save typeof(this) ()
2.9.2 Attributes
2.9.2.1 url string
2.9.2.2 email string
2.9.3 Functions
2.9.3.1 match RegexMatch!(Range) (Range, E)(Range r, E[] engine, string opt = null)
2.9.3.2 match RegexMatch!(Range) (Range, Engine)(Range r, Engine engine)

RegexMatch!(Range) match(Range, Engine)(Range r, Engine engine) if (is(Unqual!Engine == Regex!(Unqual!(typeof(Range.init[0])))))

2.9.3.3 regex Regex!(Unqual!(typeof(String.init[0]))) (String)(String pattern, string flags = null)
2.9.3.4 replace Range (alias fun, Range, Regex)(Range s, Regex rx)
2.9.3.5 replace Range (Range, Engine, String)(Range input, Engine regex, String format)

Range replace(Range, Engine, String)(Range input, Engine regex, String format) if (is(Unqual!Engine == Regex!(Unqual!(typeof(Range.init[0])))))

2.9.3.6 split String[] (String)(String input, Regex!(char) rx)
2.9.3.7 splitter Splitter!(Range) (Range, Regex)(Range r, Regex pat)

Splitter!(Range) splitter(Range, Regex)(Range r, Regex pat) if (is(Unqual!(typeof(Range.init[0])) == char))

2.10 std.stdio

Standard I/O functions that extend std.c.stdio. std.c.stdio is publically imported when importing std.stdio. Authors: Walter Bright, Andrei Alexandrescu

2.10.1 Structs
2.10.1.1 File

Encapsulates a FILE*. Generally D does not attempt to provide thin wrappers over equivalent functions in the C standard library, but manipulating FILE* values directly is unsafe and error-prone in many ways. The File type ensures safe manipulation, automatic file closing, and a lot of convenience. The underlying FILE* handle is maintained in a reference-counted manner, such that as soon as the last File variable bound to a given FILE* goes out of scope, the underlying FILE* is automatically closed.

2.10.1.1.1 Structs
2.10.1.1.1.1 ByChunk

Range that reads a chunk at a time.

2.10.1.1.1.1.1 Functions
2.10.1.1.1.1.1.1 this (File file, size_t size)
2.10.1.1.1.1.1.2 empty bool () const
2.10.1.1.1.1.1.3 front ubyte[] ()
2.10.1.1.1.1.1.4 popFront void ()
2.10.1.1.1.2 LockingTextWriter

Range that locks the file and allows fast writing to it.

2.10.1.1.1.2.1 Attributes
2.10.1.1.1.2.1.1 fps FILE*
2.10.1.1.1.2.1.2 handle _iobuf*
2.10.1.1.1.2.1.3 orientation int
2.10.1.1.1.2.2 Functions
2.10.1.1.1.2.2.1 this (ref File f)
2.10.1.1.1.2.2.2 this (this)
2.10.1.1.1.2.2.3 put void (A)(A writeme) if (is(ElementType!A : const(dchar)))
2.10.1.1.1.2.2.4 put void (C)(C c) if (is(C : const(dchar)))
2.10.1.1.1.3 ByLine

Range that reads one line at a time.

2.10.1.1.1.3.1 Attributes
2.10.1.1.1.3.1.1 file File
2.10.1.1.1.3.1.2 keepTerminator KeepTerminator
2.10.1.1.1.3.1.3 line Char[]
2.10.1.1.1.3.1.4 terminator Terminator
2.10.1.1.1.3.2 Functions
2.10.1.1.1.3.2.1 this (File f, KeepTerminator kt = KeepTerminator.no, Terminator terminator = '\n')
2.10.1.1.1.3.2.2 empty bool () const
2.10.1.1.1.3.2.3 front Char[] ()
2.10.1.1.1.3.2.4 popFront void ()
2.10.1.1.2 Attributes
2.10.1.1.2.1 KeepTerminator enum
2.10.1.1.3 Functions
2.10.1.1.3.1 this (string name, in char[] stdioOpenmode = "rb")
2.10.1.1.3.2 this (this)
2.10.1.1.3.3 byChunk ByChunk (size_t chunkSize)
2.10.1.1.3.4 byLine ByLine!(Char, Terminator) (Terminator = char, Char = char)(KeepTerminator keepTerminator = KeepTerminator.no, Terminator terminator = '\n')
2.10.1.1.3.5 clearerr void ()
2.10.1.1.3.6 close void ()
2.10.1.1.3.7 detach void ()
2.10.1.1.3.8 eof bool () const
2.10.1.1.3.9 error bool () const
2.10.1.1.3.10 fileno int () const
2.10.1.1.3.11 flush void ()
2.10.1.1.3.12 getFP FILE* ()
2.10.1.1.3.13 isOpen bool () const
2.10.1.1.3.14 lockingTextWriter LockingTextWriter ()
2.10.1.1.3.15 name string () const
2.10.1.1.3.16 opAssign void (File rhs)
2.10.1.1.3.17 open void (string name, in char[] stdioOpenmode = "rb")
2.10.1.1.3.18 popen void (string command, in char[] stdioOpenmode = "r")

Posix version only

2.10.1.1.3.19 rawRead T[] (T)(T[] buffer)
2.10.1.1.3.20 rawWrite void (T)(in T[] buffer)
2.10.1.1.3.21 readf size_t (Data...)(in char[] format, Data data)
2.10.1.1.3.22 readln S (S = string)(dchar terminator = '\n')
2.10.1.1.3.23 readln size_t (C)(ref C[] buf, dchar terminator = '\n')
2.10.1.1.3.24 readln size_t (C, R)(ref C[] buf, R terminator)
2.10.1.1.3.25 rewind void ()
2.10.1.1.3.26 seek void (long offset, int origin = SEEK_SET)
2.10.1.1.3.27 setvbuf void (size_t size, int mode = _IOFBF)
2.10.1.1.3.28 setvbuf void (void[] buf, int mode = _IOFBF)
2.10.1.1.3.29 tell ulong () const
2.10.1.1.3.30 tmpfile static File ()
2.10.1.1.3.31 wrapFile static File (FILE* f)
2.10.1.1.3.32 write void (S...)(S args)
2.10.1.1.3.33 writef void (S...)(S args)
2.10.1.1.3.34 writefln void (S...)(S args)
2.10.1.1.3.35 writeln void (S...)(S args)
2.10.1.2 LockingTextReader
2.10.1.2.1 Functions
2.10.1.2.1.1 this (File f)
2.10.1.2.1.2 this (this)
2.10.1.2.1.3 ~this ()
2.10.1.2.1.4 byChunk ByChunk (size_t chunkSize)
2.10.1.2.1.5 clearerr void ()
2.10.1.2.1.6 close void ()
2.10.1.2.1.7 detach void ()
2.10.1.3 lines

Iterates through the lines of a file by using foreach. void main() { foreach (string line; lines(stdin)) { ... use line ... } }

2.10.1.3.1 Functions
2.10.1.3.1.1 this (File f, dchar terminator = '\n')
2.10.1.3.1.2 opApply int (D)(scope D dg)
2.10.1.3.1.3 opApplyRaw int (D)(scope D dg)
2.10.1.4 chunks

Iterates through a file a chunk at a time by using foreach. void main() { foreach (ubyte[] buffer; chunks(stdin, 4096)) { ... use buffer ... } }

2.10.1.4.1 Functions
2.10.1.4.1.1 this (File f, size_t size)
2.10.1.4.1.2 opApply int (D)(scope D dg)
2.10.1.5 ByRecord(Fields...)
2.10.1.5.1 Functions
2.10.1.5.1.1 this (File f, string format)
2.10.1.5.1.2 empty bool ()
2.10.1.5.1.3 popFront void ()
2.10.2 Classes
2.10.2.1 StdioException : Exception
2.10.2.1.1 Functions
2.10.2.1.1.1 this (string message, uint e = .getErrno)
2.10.2.1.1.2 opCall void (string msg)
2.10.2.1.1.3 opCall void ()
2.10.3 Functions
2.10.3.1 readf void (A...)(in char[] format, A args)

Formatted read one line from stdin.

2.10.3.2 readln string (dchar terminator = '\n')

Read line from stream fp. Returns: null for end of file, char[] for line read from fp, including terminating character Parameters: Throws: StdioException on error Example: Reads stdin and writes it to stdout. import std.stdio; int main() { char[] buf; while ((buf = readln()) != null) write(buf); return 0; }

2.10.3.3 readln size_t (ref char[] buf, dchar terminator = '\n')

Read line from stream fp. Returns: null for end of file, char[] for line read from fp, including terminating character Parameters: Throws: StdioException on error Example: Reads stdin and writes it to stdout. import std.stdio; int main() { char[] buf; while ((buf = readln()) != null) write(buf); return 0; }

2.10.3.4 write void (T...)(T args) if (!is(T[0] : File))

if (!is(T[0] : File))

2.10.3.5 writef void (T...)(T args)

If the first argument args[0] is a FILE*, use the format specifier in args[1] to control the formatting of args[2..$], and write the resulting string to args[0]. If arg[0] is not a FILE*, the call is equivalent to writef(stdout, args). IMPORTANT: New behavior starting with D 2.006: unlike previous versions, writef (and also writefln) only scans its first string argument for format specifiers, but not subsequent string arguments. This decision was made because the old behavior made it unduly hard to simply print string variables that occasionally embedded percent signs. Also new starting with 2.006 is support for positional parameters with POSIX syntax. Example: writef("Date: %2$s %1$s", "October", 5); // "Date: 5 October" The positional and non-positional styles can be mixed in the same format string. (POSIX leaves this behavior undefined.) The internal counter for non-positional parameters tracks the popFront parameter after the largest positional parameter already used. New starting with 2.008: raw format specifiers. Using the "%r" specifier makes writef simply write the binary representation of the argument. Use "%-r" to write numbers in little endian format, "%+r" to write numbers in big endian format, and "%r" to write numbers in platform-native format.

2.10.3.6 writefln void (T...)(T args)

Equivalent to writef(args, '\n').

2.10.3.7 writeln void (T...)(T args)

if (T.length == 0)

2.10.3.8 writeln void (T...)(T args)

if (T.length == 1 && is(typeof(args[0]) : const(char)[]))

2.10.3.9 writeln void (T...)(T args)

if (T.length > 1 || T.length == 1 && !is(typeof(args[0]) : const(char)[]))

2.11 std.string

String handling functions. Objects of types string, wstring, and dstring are value types and cannot be mutated element-by-element. For using mutation during building strings, use char[], wchar[], or dchar[]. The *string types are preferable because they don't exhibit undesired aliasing, thus making code more robust. Authors: Walter Bright, Andrei Alexandrescu

2.11.1 Structs
2.11.1.1 ByCodeUnit
2.11.1.1.1 Functions
2.11.1.1.1.1 this (Range input)
2.11.1.1.1.2 back ElementType ()
2.11.1.1.1.3 empty bool ()
2.11.1.1.1.4 front ElementType ()
2.11.1.1.1.5 popBack void ()
2.11.1.1.1.6 popFront void ()
2.11.2 Attributes
2.11.2.1 CaseSensitive enum

yes, no

2.11.2.2 digits char[10]
2.11.2.3 hexdigits char[16]
2.11.2.4 letters char[52]
2.11.2.5 lowercase char[26]
2.11.2.6 LS dchar
2.11.2.7 newline char[2]
2.11.2.8 octdigits char[8]
2.11.2.9 PS dchar
2.11.2.10 uppercase char[26]
2.11.2.11 whitespace char[6]
2.11.3 Functions
2.11.3.1 abbrev string[string] (string[] values)
2.11.3.2 byDchar ByCodeUnit!(Range, dchar) (Range)(Range s)
2.11.3.3 capitalize string (string s)
2.11.3.4 capwords string (string s)
2.11.3.5 center string (string s, int width)
2.11.3.6 chomp C[] (C)(C[] s)
2.11.3.7 chomp C[] (C, C1)(C[] s, in C1[] delimiter)
2.11.3.8 chompPrefix C1[] (C1, C2)(C1[] longer, C2[] shorter)
2.11.3.9 chop string (string s)
2.11.3.10 cmp int (C1, C2)(in C1[] s1, in C2[] s2)
2.11.3.11 column size_t (string str, int tabsize = 8)
2.11.3.12 count size_t (in char[] s, in char[] sub)
2.11.3.13 countchars size_t (string s, string pattern)
2.11.3.14 endsWith bool (A1, A2)(A1 longer, A2 shorter)
2.11.3.15 entab string (string s, int tabsize = 8)
2.11.3.16 expandtabs string (string str, int tabsize = 8)
2.11.3.17 format string (...)
2.11.3.18 icmp sizediff_t (C1, C2)(in C1[] s1, in C2[] s2)

Compare two ranges of characters lexicographically. cmp is case sensitive, icmp is case insensitive. cmp is aliased from std.algorithm.cmp. icmp works like cmp but converts both characters to lowercase prior to applying pred. Technically icmp(r1, r2) is equivalent to cmp!"toUniLower(a) < toUniLower(b)"(r1, r2). Returns (for pred = "a < b"): < 0 s1 < s2 = 0 s1 == s2 > 0 s1 > s2

2.11.3.19 indexOf sizediff_t (Char)(in Char[] s, dchar c, CaseSensitive cs = CaseSensitive.yes)
2.11.3.20 indexOf sizediff_t (Char1, Char2)(const(Char1)[] s, const(Char2)[] sub, CaseSensitive cs = CaseSensitive.yes)
2.11.3.21 inPattern bool (dchar c, in string pattern)
2.11.3.22 inPattern int (dchar c, string[] patterns)
2.11.3.23 insert string (string s, size_t index, string sub)
2.11.3.24 isNumeric bool (...)
2.11.3.25 isNumeric bool (TypeInfo[] _arguments, va_list _argptr)
2.11.3.26 isNumeric final bool (string s, in bool bAllowSep = false)
2.11.3.27 iswhite bool (dchar c)
2.11.3.28 join string (in string[] words, string sep)
2.11.3.29 lastIndexOf ptrdiff_t (in char[] s, dchar c, CaseSensitive cs = CaseSensitive.yes)
2.11.3.30 lastIndexOf ptrdiff_t (in char[] s, in char[] sub, CaseSensitive cs = CaseSensitive.yes)
2.11.3.31 ljustify string (string s, size_t width)
2.11.3.32 maketrans string (in string from, in string to)
2.11.3.33 munch S1 (S1, S2)(ref S1 s, S2 pattern)
2.11.3.34 removechars string (string s, in string pattern)
2.11.3.35 repeat string (string s, size_t n)
2.11.3.36 replace string (string s, string from, string to)
2.11.3.37 replaceSlice string (string s, in string slice, in string replacement)
2.11.3.38 rjustify string (string s, size_t width)
2.11.3.39 sformat char[] (char[] s, ...)
2.11.3.40 soundex char[] (string string, char[] buffer = null)
2.11.3.41 split S[] (S)(S s)
2.11.3.42 split Unqual!(S1)[] (S1, S2)(S1 s, S2 delim)
2.11.3.43 splitlines S[] (S)(S s)
2.11.3.44 splitter auto (String)(String s)
2.11.3.45 squeeze string (string s, string pattern = null)
2.11.3.46 startsWith bool (A1, A2)(A1 longer, A2 shorter)
2.11.3.47 strip String (String)(String s)
2.11.3.48 stripl String (String)(String s)
2.11.3.49 stripr String (String)(String s)
2.11.3.50 succ string (string s)
2.11.3.51 tolower S (S)(S s)
2.11.3.52 tolowerInPlace void (C)(ref C[] s)
2.11.3.53 toStringz immutable(char)* (const(char)[] s)
2.11.3.54 toStringz immutable(char)* (string s)
2.11.3.55 toupper S (S)(S s)
2.11.3.56 toupperInPlace void (C)(ref C[] s)
2.11.3.57 tr string (string str, string from, string to, string modifiers = null)
2.11.3.58 translate string (string s, in string transtab, in string delchars)
2.11.3.59 wrap string (string s, int columns = 80, string firstindent = null, string indent = null, int tabsize = 8)
2.11.3.60 zfill string (string s, int width)
2.12 std.json

JavaScript Object Notation Authors: Jeremie Pelletier

2.12.1 Structs
2.12.1.1 JSONValue

JSON value node

2.12.1.1.1 Attributes
2.12.1.1.1.1 Union
2.12.1.1.1.1.1 str string
2.12.1.1.1.1.2 integer long
2.12.1.1.1.1.3 floating real
2.12.1.1.1.1.4 object JSONValue[string]
2.12.1.1.1.1.5 array JSONValue[]
2.12.1.1.1.2 type JSON_TYPE
2.12.2 Classes
2.12.2.1 JSONException : Exception
2.12.3 Attributes
2.12.3.1 JSON_TYPE enum : byte

enum JSON_TYPE : byte { STRING, INTEGER, FLOAT, OBJECT, ARRAY, TRUE, FALSE, NULL }

2.12.4 Functions
2.12.4.1 parseJSON JSONValue (T)(T json, int maxDepth = -1)

if(isInputRange!T) Parses a serialized string and returns a tree of JSON values.

2.12.4.2 toJSON string (in JSONValue* root)

Takes a tree of JSON values and returns the serialized string.

3 Deprecated
3.1 std.date

Dates are represented in several formats. The date implementation revolves around a central type, d_time, from which other formats are converted to and from. Dates are calculated using the Gregorian calendar. Authors: Walter Bright

3.1.1 Structs
3.1.1.1 Date

Time broken down into its components.

3.1.1.1.1 Attributes
3.1.1.1.1.1 day int
3.1.1.1.1.2 hour int
3.1.1.1.1.3 minute int
3.1.1.1.1.4 month int
3.1.1.1.1.5 ms int
3.1.1.1.1.6 second int
3.1.1.1.1.7 tzcorrection int

-1200..1200 correction in hours

3.1.1.1.1.8 weekday int

0: not specified, 1..7: Sunday..Saturday

3.1.1.1.1.9 year int

use int.min as "nan" year value

3.1.1.1.2 Functions
3.1.1.1.2.1 parse void (string s)

Parse date out of string s[] and store it in this Date instance.

3.1.2 Attributes
3.1.2.1 d_time alias long

d_time is a signed arithmetic type giving the time elapsed since January 1, 1970. Negative values are for dates preceding 1970. The time unit used is Ticks. Ticks are milliseconds or smaller intervals. The usual arithmetic operations can be performed on d_time, such as adding, subtracting, etc. Elapsed time in Ticks can be computed by subtracting a starting d_time from an ending d_time.

3.1.2.2 d_time_nan d_time
3.1.2.3 DosFileTime uint
3.1.2.4 hoursPerDay enum
3.1.2.5 localTZA d_time __gshared
3.1.2.6 minutesPerHour enum
3.1.2.7 msPerDay enum
3.1.2.8 msPerHour enum
3.1.2.9 msPerMinute enum
3.1.2.10 ticksPerDay enum
3.1.2.11 ticksPerHour enum
3.1.2.12 ticksPerMinute enum
3.1.2.13 ticksPerMs enum
3.1.2.14 ticksPerSecond enum

Will be at least 1000

3.1.3 Functions
3.1.3.1 benchmark ulong[] (fun...)(uint times, ulong[] result = null)

Benchmarks code for speed assessment and comparison. Parameters: fun aliases of callable objects (e.g. function names). Each should take no arguments. times The number of times each function is to be executed. result The optional store for the return value. If null is passed in, new store is allocated appropriately. Returns: An array of n uints. Element at slot i contains the number of milliseconds spent in calling the ith function times times.

3.1.3.2 d_time2FILETIME FILETIME (d_time dt)
3.1.3.3 dateFromNthWeekdayOfMonth int (int year, int month, int weekday, int n)

Determine the date in the month, 1..31, of the nth weekday. Parameters: int year year int month month, 1..12 int weekday day of week 0..6 representing Sunday..Saturday int n nth occurrence of that weekday in the month, 1..5, where 5 also means "the last occurrence in the month" Returns: the date in the month, 1..31, of the nth weekday

3.1.3.4 dateFromTime int (d_time t)
3.1.3.5 day int (d_time t)
3.1.3.6 dayFromYear pure int (int year)
3.1.3.7 daylightSavingTA int (d_time dt)
3.1.3.8 daysInMonth int (int year, int month)
3.1.3.9 daysInYear pure uint (uint year)
3.1.3.10 dmod int (d_time n, d_time d)
3.1.3.11 FILETIME2d_time static d_time (const FILETIME *ft)
3.1.3.12 floor pure d_time (d_time d, int divisor)

Divide time by divisor. Always round down, even if d is negative.

3.1.3.13 getLocalTZA d_time ()
3.1.3.14 getUTCtime d_time ()
3.1.3.15 hourFromTime int (d_time time)
3.1.3.16 inLeapYear pure bool (d_time t)
3.1.3.17 leapYear pure bool (uint y)
3.1.3.18 localTimetoUTC d_time (d_time t)
3.1.3.19 makeDate d_time (d_time day, d_time time)
3.1.3.20 makeDay d_time (d_time year, d_time month, d_time date)
3.1.3.21 makeTime d_time (d_time hour, d_time min, d_time sec, d_time ms)
3.1.3.22 minFromTime int (d_time time)
3.1.3.23 monthFromTime int (d_time t)
3.1.3.24 msFromTime int (d_time time)
3.1.3.25 parse d_time (string s)

Parses s as a textual date string, and returns it as a d_time. If the string is not a valid date, d_time_nan is returned.

3.1.3.26 secFromTime int (d_time time)
3.1.3.27 SYSTEMTIME2d_time static d_time (const SYSTEMTIME *st, d_time t)
3.1.3.28 timeClip d_time (d_time time)
3.1.3.29 timeFromYear pure d_time (int y)
3.1.3.30 timeWithinDay int (d_time t)
3.1.3.31 toDateString string (d_time time)

Converts the date portion of time into a text string of the form: "Www Mmm dd yyyy", for example, "Tue Apr 02 1996". If time is invalid, "Invalid date" is returned.

3.1.3.32 toDosFileTime DosFileTime (d_time t)
3.1.3.33 toDtime d_time (DosFileTime time)
3.1.3.34 toInteger d_time (d_time n)
3.1.3.35 toISO8601YearWeek void (d_time t, out int year, out int week)
3.1.3.36 toTimeString string (d_time time)

Converts the time portion of t into a text string of the form: "hh:mm:ss GMT+-TZ", for example, "02:04:57 GMT-0800". If t is invalid, "Invalid date" is returned. The input must be in UTC, and the output is in local time.

3.1.3.37 toUTCString string (d_time t)

Converts t into a text string of the form: "Www, dd Mmm yyyy hh:mm:ss UTC". If t is invalid, "Invalid date" is returned.

3.1.3.38 UTCtoLocalTime d_time (d_time t)
3.1.3.39 UTCtoString string (d_time time)

Converts UTC time into a text string of the form: "Www Mmm dd hh:mm:ss GMT+-TZ yyyy". For example, "Tue Apr 02 02:04:57 GMT-0800 1996". If time is invalid, i.e. is d_time_nan, the string "Invalid date" is returned.

3.1.3.40 weekDay int (d_time t)
3.1.3.41 yearFromTime pure int (d_time t)