tofunction 0.0.2
Converts a callable to a function.
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
toFunction
While reading Phobos documentation, have you ever wondered: Why does it have toDelegate, but not a corresponding toFunction?
Well, wonder no more! For it is now here, -BEHOLD-!
import tofunction;
int x = 0;
int delegate(int) dg = y => y*x;
int function(int) fn = toFunction(dg);
x = 6;
assert(fn(7) == 42, "The answer is 42!");
// Don't forget to free!
freeFunction(fn);
This library has only two functions:
- toFunction: Opposite of toDelegate.
- freeFunction: Releases resources allocated by toFunction.
This library is compatible with multithreading.
- Registered by Tomas
- 0.0.2 released 20 hours ago
- Tomuxs/tofunction
- MIT
- Copyright © 2026, Tomas
- Authors:
- Dependencies:
- none
- Versions:
-
Show all 3 versions0.0.2 2026-Aug-02 0.0.1 2026-Aug-02 ~master 2026-Aug-02 - Download Stats:
-
-
0 downloads today
-
2 downloads this week
-
2 downloads this month
-
2 downloads total
-
- Score:
- 0.7
- Short URL:
- tofunction.dub.pm