On Thursday, 26 May 2016 at 05:47:36 UTC, Era Scarecrow wrote:
On Thursday, 26 May 2016 at 05:20:25 UTC, vitus wrote:
Why 'alias wln1 = writeln;' doesnt't work but 'alias wln2 =
std.stdio.writeln;' work when import is not static? Why
'wln2("test");' work but 'std.stdio.writeln("test");'
Code:
mixin template MIXIN(){
import std.stdio;
alias m = writeln; //OK
}
class CLASS{
mixin MIXIN;
alias wln1 = writeln; //Error: 'writeln' is not defined,
perhaps you need to import std.stdio; ?
alias wln2 = std.stdio.writeln; //OK
void test(){
On Thursday, 27 August 2015 at 13:14:24 UTC, Daniel Kozák wrote:
On Thu, 27 Aug 2015 13:01:02 +
vitus via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
works ok for me
V tom je ten problém :)
On Monday, 24 August 2015 at 01:01:13 UTC, John Colvin wrote:
enum A = 1;
enum B = C; //Error
static if(A)
enum C = 0;
enum D = C; //OK
Is order supposed to matter here?
Beter:
enum E = 1;
struct Foo{
enum X1 = E;
static if(1) enum E = 2;
enum X2 = E;
}
static
//Why expression 'foobar(1);' doesn't work?
void foo()(){}
void bar(int){}
alias foobar = foo;
alias foobar = bar;
void main(){
.foobar(1); //OK
foobar(1); //Error: overload alias 'foo' is not a variable
}