Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Work around compiler bugs that cause linker errors
- Loading branch information
Showing
4 changed files
with
108 additions
and
91 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,30 +1,30 @@ | ||
module std2xalpha.functional; | ||
|
||
static import std.functional; | ||
|
||
// Pull all symbols from std.functional into the stdxalpha namespace. | ||
static foreach (s; __traits(allMembers, std.functional)) | ||
{ | ||
static if (__traits(compiles, mixin("{ alias "~s~" = std.functional."~s~"; }"))) | ||
{ | ||
mixin("alias "~s~" = std.functional."~s~";"); | ||
} | ||
} | ||
|
||
/** | ||
@@@TODO@@@: std2x `unaryFun` does not support string lambdas. Use function literals instead. | ||
*/ | ||
//alias unaryFun(alias func) = func; | ||
|
||
/** | ||
@@@TODO@@@: std2x `unaryFun` does not support string lambdas. Use function literals instead. | ||
*/ | ||
//alias binaryFun(alias func) = func; | ||
|
||
/// | ||
unittest | ||
{ | ||
// string literals not supported | ||
// assert(binaryFun!"a + b"(1, 1) == 2); // no longer compiles | ||
assert(binaryFun!((a, b) => a + b)(1, 1) == 2); // works | ||
} | ||
module std2xalpha.functional; | ||
|
||
static import std.functional; | ||
|
||
// Pull all symbols from std.functional into the stdxalpha namespace. | ||
static foreach (s; __traits(allMembers, std.functional)) | ||
{ | ||
static if (__traits(compiles, mixin("{ alias "~s~" = std.functional."~s~"; }"))) | ||
{ | ||
mixin("alias "~s~" = std.functional."~s~";"); | ||
} | ||
} | ||
|
||
/** | ||
@@@TODO@@@: std2x `unaryFun` does not support string lambdas. Use function literals instead. | ||
*/ | ||
//alias unaryFun(alias func) = func; | ||
|
||
/** | ||
@@@TODO@@@: std2x `unaryFun` does not support string lambdas. Use function literals instead. | ||
*/ | ||
//alias binaryFun(alias func) = func; | ||
|
||
/// | ||
unittest | ||
{ | ||
// string literals not supported | ||
// assert(binaryFun!"a + b"(1, 1) == 2); // no longer compiles | ||
assert(binaryFun!((a, b) => a + b)(1, 1) == 2); // works | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module std2xalpha.traits; | ||
|
||
public import std.traits; | ||
module std2xalpha.traits; | ||
|
||
public import std.traits; |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module std2xalpha.typecons; | ||
|
||
public import std.typecons; | ||
module std2xalpha.typecons; | ||
|
||
public import std.typecons; |