Skip to content

Commit

Permalink
CacheMap
Browse files Browse the repository at this point in the history
- Made `ReplacementDelegate` and `ReplacementFunction` public and added documentation
  • Loading branch information
deavmi committed Dec 4, 2023
1 parent 3dc31ff commit e722867
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions source/niknaks/containers.d
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,23 @@ private template Entry(V)
*/
public template CacheMap(K, V)
{
private alias ReplacementDelegate = V delegate(K);
private alias ReplacementFunction = V function(K);
/**
* A replacement function which takes
* in the key of type `K` and returns
* a value of type `V`
*
* This is the delegate-based variant
*/
public alias ReplacementDelegate = V delegate(K);

/**
* A replacement function which takes
* in the key of type `K` and returns
* a value of type `V`
*
* This is the function-based variant
*/
public alias ReplacementFunction = V function(K);

/**
* A caching map which when queried
Expand Down

0 comments on commit e722867

Please sign in to comment.