ae.utils.meta.misc

Metaprogramming miscellanea

Members

Aliases

I
alias I(alias A) = A

Shorter synonym for std.traits.Identity. Can be used to UFCS-chain static methods and nested functions.

IsDebug
deprecated alias IsDebug = isDebug
Undocumented in source.

Functions

mixGenerateContructorProxies
string mixGenerateContructorProxies()
Undocumented in source. Be warned that the author may not have intended to support it.

Manifest constants

HAVE_UDA
enum HAVE_UDA;
Undocumented in source.
isDebug
enum isDebug;
Undocumented in source.
isDebug
enum isDebug;
Undocumented in source.

Mixin templates

FieldList
mixintemplate FieldList(Fields...)

Like std.typecons.Tuple, but a template mixin. Unlike std.typecons.Tuple, names may not be omitted - but repeating types may be.

GenerateContructorProxies
mixintemplate GenerateContructorProxies()

Generate constructors that simply call the parent class constructors. Based on http://forum.dlang.org/post/i3hpj0$2vc6$1@digitalmars.com

Properties

isHomogenous
bool isHomogenous [@property getter]

Return true if all of T's fields are the same type.

singleton
T singleton [@property getter]

Generate a @property function which creates/returns a thread-local singleton of a class with the given arguments.

structFields
string[] structFields [@property getter]

Evaluates to array of strings with name for each field.

Static functions

findParameter
size_t findParameter()
size_t findParameter(string[] searchedNames, string soughtNames, string funName)

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.

Templates

ArrayToTuple
template ArrayToTuple(alias arr, Elements...)
Undocumented in source.
CTIterate
template CTIterate(alias A)

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.

EnumLength
template EnumLength(T)

One past the biggest element of the enum T.

GenFieldList
template GenFieldList(T, Fields...)
Undocumented in source.
RangeTuple
template RangeTuple(size_t N)

Generate a tuple containing integers from 0 to N-1. Useful for static loop unrolling. (staticIota)

RangeTupleImpl
template RangeTupleImpl(size_t N, R...)
Undocumented in source.
SignedBitsType
template SignedBitsType(uint bits)
Undocumented in source.
UnsignedBitsType
template UnsignedBitsType(uint bits)

Unsigned integer type big enough to fit N bits of precision.

ValueTuple
template ValueTuple(T...)

Same as TypeTuple, but meant to be used with values.

findValueOfTypeInTuple
template findValueOfTypeInTuple(X, T...)
Undocumented in source.
getAttribute
template getAttribute(T, alias D)
Undocumented in source.
getAttribute
template getAttribute(T, alias D)
Undocumented in source.
hasAttribute
template hasAttribute(T, alias D)
Undocumented in source.
hasAttribute
template hasAttribute(T, alias D)
Undocumented in source.
isValueOfTypeInTuple
template isValueOfTypeInTuple(X, T...)
Undocumented in source.
stringofArray
template stringofArray(Args...)
Undocumented in source.
thisOf
template thisOf(alias f)

Get f's ancestor which represents its "this" pointer. Skips template and mixin ancestors until it finds a struct or class.

Meta

License

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/.

Authors

Vladimir Panteleev <vladimir@thecybershadow.net>