Skip to content

Commit

Permalink
Merge pull request #1111 from aG0aep6G/std.meta-no-arglist
Browse files Browse the repository at this point in the history
std.meta.arglist -> std.meta
  • Loading branch information
9rnsr committed Sep 26, 2015
2 parents 6fdf1cf + d0c72c6 commit f7e8927
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions ctarguments.dd
Expand Up @@ -45,7 +45,8 @@ $(D_S Compile-time Argument Lists,

$(P However, the language itself does not provide any means to define such lists outside of
a template parameter declaration. Instead, there is a
$(LINK2 phobos/std_meta_arglist.html, simple utility) provided by the D standard library:
$(LINK2 phobos/std_meta.html, simple utility) provided by the D standard
library:
)

---
Expand All @@ -57,7 +58,7 @@ $(D_S Compile-time Argument Lists,
)

---
import std.meta.arglist;
import std.meta;
// can alias to some other name
alias Name = AliasSeq!(int, 42);
pragma(msg, Name[0]);
Expand All @@ -71,7 +72,7 @@ $(H3 Available operations)
$(H4 Checking the length)

---
import std.meta.arglist;
import std.meta;
static assert (AliasSeq!(1, 2, 3, 4).length == 4);
---

Expand All @@ -80,7 +81,7 @@ $(H3 Available operations)
$(P Indexes must be known at compile-time)

---
import std.meta.arglist;
import std.meta;
alias Numbers = AliasSeq!(1, 2, 3, 4);
static assert (Numbers[1] == 2);
alias SubNumbers = Numbers[1 .. $];
Expand All @@ -92,7 +93,7 @@ $(H3 Available operations)
$(P Works only if the list element is a symbol that refers to a mutable variable)

---
import std.meta.arglist;
import std.meta;

void main()
{
Expand All @@ -113,7 +114,7 @@ $(H3 Available operations)
)

---
import std.meta.arglist;
import std.meta;

void main()
{
Expand Down Expand Up @@ -142,7 +143,7 @@ $(H3 Auto-expansion)
)

---
import std.meta.arglist;
import std.meta;

template Print0(T...)
{
Expand All @@ -168,15 +169,15 @@ $(H3 Homogenous lists)
$(P It is possible to use homogenous type lists in declarations:)

---
import std.meta.arglist;
import std.meta;
alias Params = AliasSeq!(int, double, string);
void foo(Params); // void foo(int, double, string);
---

$(P D supports a special variable declaration syntax where a type list acts as a type:)

---
import std.meta.arglist;
import std.meta;

void foo()
{
Expand Down Expand Up @@ -208,7 +209,7 @@ $(H3 Homogenous lists)
$(P It is possible to use expression lists with values of the same type to declare array literals:)

---
import std.meta.arglist;
import std.meta;
static assert ([ AliasSeq!(1, 2, 3) ] == [ 1, 2, 3 ]);
---

Expand Down

0 comments on commit f7e8927

Please sign in to comment.