Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove phobos dependency from issue 4003 test case
- Loading branch information
Showing
6 changed files
with
37 additions
and
14 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module imports.stdio4003; | ||
|
||
import imports.typecons4003; |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
module imports.test4003a; | ||
|
||
import imports.typecons4003; | ||
|
||
Tuple!(string) t; | ||
|
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module imports.typecons4003; | ||
|
||
struct Tuple(T...) | ||
{ | ||
alias T Types; | ||
Types field; | ||
|
||
ref Tuple!(Types[from .. to]) slice(uint from, uint to)() | ||
{ | ||
return *cast(typeof(return) *) &(field[from]); | ||
} | ||
|
||
void test() //unittest | ||
{ | ||
.Tuple!(int, string, float, double) a; | ||
a.field[1] = "abc"; | ||
a.field[2] = 4.5; | ||
auto s = a.slice!(1, 3); | ||
static assert(is(typeof(s) == Tuple!(string, float))); | ||
//assert(s.field[0] == "abc" && s.field[1] == 4.5); | ||
} | ||
} |
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 |
---|---|---|
@@ -0,0 +1,6 @@ | ||
// EXTRA_SOURCES: imports/test4003a.d | ||
// PERMUTE_ARGS: | ||
|
||
import imports.stdio4003; | ||
void main(){} | ||
|
This file was deleted.
Oops, something went wrong.