Skip to content

Commit a2d99d9

Browse files
authored
[std.typecons docs] Fix links (#10912)
Add Reference Counting link section, add `borrow`. Add NotImplementedError link. Add `apply` link. Add ReplaceTypeUnless link, regroup ReplaceType. Add LREFs. Show `apply` and `borrow` function signatures in docs.
1 parent 7dad7c2 commit a2d99d9

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

std/typecons.d

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,15 @@ $(TR $(TD Flags) $(TD
2121
$(LREF No)
2222
$(LREF Yes)
2323
))
24-
$(TR $(TD Memory allocation) $(TD
24+
$(TR $(TD Reference Counting) $(TD
25+
$(LREF borrow)
26+
$(LREF RefCountedAutoInitialize)
27+
$(LREF RefCounted)
28+
$(LREF refCounted)
2529
$(LREF SafeRefCounted)
2630
$(LREF safeRefCounted)
27-
$(LREF RefCountedAutoInitialize)
31+
))
32+
$(TR $(TD Memory allocation) $(TD
2833
$(LREF scoped)
2934
$(LREF Unique)
3035
))
@@ -33,9 +38,11 @@ $(TR $(TD Code generation) $(TD
3338
$(LREF BlackHole)
3439
$(LREF generateAssertTrap)
3540
$(LREF generateEmptyFunction)
41+
$(LREF NotImplementedError)
3642
$(LREF WhiteHole)
3743
))
3844
$(TR $(TD Nullable) $(TD
45+
$(LREF apply)
3946
$(LREF Nullable)
4047
$(LREF nullable)
4148
$(LREF NullableRef)
@@ -45,12 +52,13 @@ $(TR $(TD Proxies) $(TD
4552
$(LREF Proxy)
4653
$(LREF rebindable)
4754
$(LREF Rebindable)
48-
$(LREF ReplaceType)
4955
$(LREF unwrap)
5056
$(LREF wrap)
5157
))
5258
$(TR $(TD Types) $(TD
5359
$(LREF alignForSize)
60+
$(LREF ReplaceType)
61+
$(LREF ReplaceTypeUnless)
5462
$(LREF Ternary)
5563
$(LREF Typedef)
5664
$(LREF TypedefType)
@@ -5255,7 +5263,7 @@ if (is (typeof(nullValue) == T))
52555263

52565264
// apply
52575265
/**
5258-
Unpacks the content of a `Nullable`, performs an operation and packs it again. Does nothing if isNull.
5266+
Unpacks the content of a $(LREF Nullable), performs an operation and packs it again. Does nothing if $(LREF isNull).
52595267
52605268
When called on a `Nullable`, `apply` will unpack the value contained in the `Nullable`,
52615269
pass it to the function you provide and wrap the result in another `Nullable` (if necessary).
@@ -5275,6 +5283,7 @@ template apply(alias fun)
52755283
{
52765284
import std.functional : unaryFun;
52775285

5286+
///
52785287
auto apply(T)(auto ref T t)
52795288
if (isInstanceOf!(Nullable, T))
52805289
{
@@ -8326,6 +8335,7 @@ template borrow(alias fun)
83268335
{
83278336
import std.functional : unaryFun;
83288337

8338+
///
83298339
auto ref borrow(RC)(RC refCount)
83308340
if
83318341
(

0 commit comments

Comments
 (0)