aurorafw.stdx.typecons

Extras to std.typecons

This file defines extra functions to std.typecons.

Public Imports

std.typecons
public import std.typecons;

Members

Functions

getOr
T getOr(Nullable!T n, T t)

Gets the value inside of a nullable type or fallback to a given value

none
auto none()

Represents a non defined optional type

none
None none()

Represents a None type

oc
auto oc(T value)
Undocumented in source. Be warned that the author may not have intended to support it.
oc
auto oc(Optional!T value)
Undocumented in source. Be warned that the author may not have intended to support it.
oc
auto oc(Nullable!T value)
Undocumented in source. Be warned that the author may not have intended to support it.
optional
auto optional(T value)

Creates an optional type with a defined given value

optional
auto optional(None none)

Creates an optional type with a none

optional
auto optional()

Creates an empty optional type

some
auto some(T value)

Creates an optional type with a defined given value

some
auto some(None none)

Creates an optional type with a none

toNullable
auto toNullable(Optional!T opt)

Converts an optional type to a nullable type

toOptional
auto toOptional(R range)

Converts a input range into an optional type

toOptional
auto toOptional(Nullable!T nullable)

Converts a nullable type to an optional type

Structs

None
struct None

A type with nothing inside used by Optional

Optional
struct Optional(T)

Defines an optional type

OptionalChain
struct OptionalChain(T)
Undocumented in source.

Templates

isOptional
template isOptional(T)
Undocumented in source.
match
template match(handlers...)

Pattern matching for Nullable and Optional types

Meta

Date

Date: 2018-2020

Authors

Luís Ferreira <luis@aurorafoss.org>

License

GNU Lesser General Public License (Version 3, 29 June 2007)