std.typecons

This module implements a variety of type constructors, i.e., templates that allow construction of new, useful general-purpose types.

Constructors

this
this(T value)

Constructs a Rebindable from a given value.

this
this(T value)

Constructs a Rebindable2 from a given value.

Destructor

A destructor is present on this object, but not explicitly documented in the source.

Alias This

get

Members

Enums

isTuple
eponymoustemplate isTuple(T)

Returns true if and only if T is an instance of std.typecons.Tuple.

Functions

get
T get()

Returns the value currently stored in the Rebindable.

get
inout(T) get()

Returns the value currently stored in the Rebindable2.

get
T get()

Returns the value currently stored in the Rebindable2.

opAssign
void opAssign(T value)

Overwrites the currently stored value with value.

opAssign
void opAssign(T value)

Overwrites the currently stored value with value.

reverse
auto reverse(T t)

Creates a copy of a Tuple with its fields in reverse order.

Structs

Rebindable
struct Rebindable(T)

Rebindable!(T) is a simple, efficient wrapper that behaves just like an object of type T, except that you can reassign it to refer to another object. For completeness, Rebindable!(T) aliases itself away to T if T is a non-const object type.

Unique
struct Unique(T)

Encapsulates unique ownership of a resource.

Templates

Rebindable
template Rebindable(T)

Rebindable!(T) is a simple, efficient wrapper that behaves just like an object of type T, except that you can reassign it to refer to another object. For completeness, Rebindable!(T) aliases itself away to T if T is a non-const object type.

Tuple
template Tuple(Specs...)

Tuple of values, for example Tuple!(int, string) is a record that stores an int and a string. Tuple can be used to bundle values together, notably when returning multiple values from a function. If obj is a Tuple, the individual members are accessible with the syntax obj[0] for the first field, obj[1] for the second, and so on.

tuple
template tuple(Names...)

Constructs a Tuple object instantiated and initialized according to the given arguments.

Meta

Authors

Andrei Alexandrescu, Bartosz Milewski, Don Clugston, Shin Fujishiro, Kenji Hara