Created
September 22, 2023 04:21
-
-
Save run-dlang/218b69e1afd79e5944ea10aa7ca61e1b to your computer and use it in GitHub Desktop.
Code shared from run.dlang.io. Run with '-unittest'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import std.stdio; | |
void main() | |
{ | |
import std.parallelism; | |
auto a = new A(); | |
auto fn = &a.download; | |
string url = "https://raw.githubusercontent.com/dlang/dmd/master/VERSION"; | |
auto async_task = task!fn( url ); // error | |
async_task.executeInNewThread(); | |
writeln("OK"); | |
} | |
class A | |
{ | |
void download( string url ) | |
{ | |
// DO | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
remove this