Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 14 additions & 4 deletions std/typecons.d
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,15 @@ $(TR $(TD Flags) $(TD
$(LREF No)
$(LREF Yes)
))
$(TR $(TD Memory allocation) $(TD
$(TR $(TD Reference Counting) $(TD
$(LREF borrow)
$(LREF RefCountedAutoInitialize)
$(LREF RefCounted)
$(LREF refCounted)
$(LREF SafeRefCounted)
$(LREF safeRefCounted)
$(LREF RefCountedAutoInitialize)
))
$(TR $(TD Memory allocation) $(TD
$(LREF scoped)
$(LREF Unique)
))
Expand All @@ -33,9 +38,11 @@ $(TR $(TD Code generation) $(TD
$(LREF BlackHole)
$(LREF generateAssertTrap)
$(LREF generateEmptyFunction)
$(LREF NotImplementedError)
$(LREF WhiteHole)
))
$(TR $(TD Nullable) $(TD
$(LREF apply)
$(LREF Nullable)
$(LREF nullable)
$(LREF NullableRef)
Expand All @@ -45,12 +52,13 @@ $(TR $(TD Proxies) $(TD
$(LREF Proxy)
$(LREF rebindable)
$(LREF Rebindable)
$(LREF ReplaceType)
$(LREF unwrap)
$(LREF wrap)
))
$(TR $(TD Types) $(TD
$(LREF alignForSize)
$(LREF ReplaceType)
$(LREF ReplaceTypeUnless)
$(LREF Ternary)
$(LREF Typedef)
$(LREF TypedefType)
Expand Down Expand Up @@ -5255,7 +5263,7 @@ if (is (typeof(nullValue) == T))

// apply
/**
Unpacks the content of a `Nullable`, performs an operation and packs it again. Does nothing if isNull.
Unpacks the content of a $(LREF Nullable), performs an operation and packs it again. Does nothing if $(LREF isNull).

When called on a `Nullable`, `apply` will unpack the value contained in the `Nullable`,
pass it to the function you provide and wrap the result in another `Nullable` (if necessary).
Expand All @@ -5275,6 +5283,7 @@ template apply(alias fun)
{
import std.functional : unaryFun;

///
auto apply(T)(auto ref T t)
if (isInstanceOf!(Nullable, T))
{
Expand Down Expand Up @@ -8326,6 +8335,7 @@ template borrow(alias fun)
{
import std.functional : unaryFun;

///
auto ref borrow(RC)(RC refCount)
if
(
Expand Down
Loading