Named method and struct literal arguments
Method binding - using alias inference patch Currently dysfunctional.
Method binding - before alias inference
Compiler capability detection
Proxy objects
Basic reference-counting for classes.
Reference type abstraction
Tuple ranges
An implementation of Timon Gehr's X template
What to use instead of void for boxVoid/unboxVoid. Use a zero-length array instead of an empty struct as this one has a .sizeof of 0, unlike the struct.
Expand to a built-in numeric type of the same kind (signed integer / unsigned integer / floating-point) with at least additionalBits more bits of precision.
Shorter synonym for std.traits.Identity. Can be used to UFCS-chain static methods and nested functions.
Lazily evaluate and return first false-ish result; otherwise return last result.
D does not allow void variables or parameters. As such, there is no "common type" for functions that return void and non-void. To allow generic metaprogramming in such cases, this function will "box" a void expression to a different type.
Returns the class's initializer instance. Returns null if all class fields are zero. Can be used to get the value of class fields' initial values.
Identity function.
Lazily evaluate and return first true-ish result; otherwise return last result.
Like progn, but return the first argument instead.
Evaluate all arguments and return the last argument. Can be used instead of the comma operator. Inspired by http://clhs.lisp.se/Body/s_progn.htm
Inverse of boxVoid. Can be used in a return statement, i.e.: return unboxVoid(someBoxedVoid);
As boxVoid/unboxVoid, but returns a struct with zero or one members. .tupleof can then be used to paste the tuple in e.g. an argument list.
Like std.typecons.Tuple, but a template mixin. Unlike std.typecons.Tuple, names may not be omitted - but repeating types may be.
Generate constructors that simply call the parent class constructors. Based on http://forum.dlang.org/post/i3hpj0$2vc6$1@digitalmars.com
A range that iterates over all members of an enum.
Return true if all of T's fields are the same type.
Generate a @property function which creates/returns a thread-local singleton of a class with the given arguments.
As above, but using arbitrary types and a factory function.
Evaluates to array of strings with name for each field.
Returns the index of fun's parameter with the name matching "names", or asserts if the parameter is not found. "names" can contain multiple names separated by slashes.
Generates a struct containing fields with names, types, and default values corresponding to a function's parameter list.
Combines the getMember and allMembers traits, to return the parameter's members as aliases.
Expand an array to a tuple. The array value must be known during compilation.
Resolves to BoxedVoid if T is void, or to T otherwise.
Return something to foreach over optimally. If A is known at compile-time, return a tuple, so the foreach is unrolled at compile-time. Otherwise, return A for a regular runtime foreach.
Generate a tuple containing integers from 0 to N-1. Useful for static loop unrolling. (staticIota)
Expand to a built-in numeric type of the same kind (signed integer / unsigned integer / floating-point) with at least the indicated number of bits of precision.
Integer type big enough to fit N bits of precision.
Like ExpandNumericType, but do not error if the resulting type is too large to fit any native D type - just expand to the largest type of the same kind instead.
Integer type big enough to fit N bits of precision.
Same as TypeTuple, but meant to be used with values.
Call a predicate with the given value. Return the value. Intended to be used in UFCS chains using functions which mutate their argument, such as skipOver and each.
One past the biggest element of the enum T.
Expand a static array to a tuple. Unlike ArrayToTuple, the array may be a runtime variable.
Returns the first value in T of type X.
Create a functor value type (bound struct) from an alias.
Retrieves the attribute (type or value of the given type).
Stub (unsupported)>
Detects types and values of the given type.
Stub (unsupported)>
Resolves to true if tuple T contains a value whose type is X.
Is a specific version on?
Apply .stringof over Args and return the result as a string[].
Generates a function which passes its arguments to a struct, which is returned. Preserves field names (as parameter names) and default values.
Get f's ancestor which represents its "this" pointer. Skips template and mixin ancestors until it finds a struct or class.
Return the number of bits used to store the value part, i.e. T.sizeof*8 for integer parts and the mantissa size for floating-point types.
Resolves to true if there exists a non-void common type for all elements of T.
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
Metaprogramming