On Wednesday, 20 January 2016 at 19:48:04 UTC, jmh530 wrote:
On Wednesday, 20 January 2016 at 19:19:04 UTC, Marc Schütz
wrote:
On Wednesday, 20 January 2016 at 16:37:31 UTC, jmh530 wrote:
I'm not sure if this is how the behavior is supposed to be or
if it is a bug.
I believe, however, that it
On Wednesday, 20 January 2016 at 19:19:04 UTC, Marc Schütz wrote:
On Wednesday, 20 January 2016 at 16:37:31 UTC, jmh530 wrote:
I'm not sure if this is how the behavior is supposed to be or
if it is a bug.
I believe, however, that it _is_ a bug that the imported
symbols are visible outside the
On Wednesday, 20 January 2016 at 16:37:31 UTC, jmh530 wrote:
I'm not sure if this is how the behavior is supposed to be or
if it is a bug.
It's not a bug. The `@attribute:` syntax applies to all following
declarations _inside the current scope_, i.e. until your mixin
templates closing `}`.
On Wednesday, 20 January 2016 at 16:37:31 UTC, jmh530 wrote:
I'm not sure if this is how the behavior is supposed to be or
if it is a bug.
I believe, however, that it _is_ a bug that the imported symbols
are visible outside the template. Most likely related to the
infamous https://issues.dlan
I was thinking about using mixin templates to put some
module-level default information in a single file so that it
doesn't clutter up other files. It works for imports, but it
doesn't seem to propagate for function attributes.
module_default.d
---
module module_default;
mixin
On Thursday, 14 February 2013 at 07:40:58 UTC, Jacob Carlborg
wrote:
This is by design. Foo and A have different overload sets. Try:
alias Foo.foo foo;
http://dlang.org/template-mixin.html
Search for: "Mixin Scope" and pay attention to:
"Alias declarations can be used to overload together fun
On 2013-02-14 01:29, cal wrote:
Should the following work?
import std.traits;
mixin template Foo()
{
void foo(T)(T t) if (isSomeString!T) {}
}
class A
{
void foo()(int i){}
mixin Foo;
}
void main()
{
auto a = new A;
a.foo("hello");
}
Error: template hello.A.foo does
On 2013-02-14 06:49, cal wrote:
And a related question:
class A
{
void foo(int i){}
void foo(Tuple!(int) i){}
}
class B: A
{
override void foo(int i){}
}
int main()
{
auto b = new B;
b.foo(tuple(5));
}
This fails to compile. Why can't B use A's tuple overload of foo
On Thursday, 14 February 2013 at 05:49:33 UTC, cal wrote:
And a related question:
class A
{
void foo(int i){}
void foo(Tuple!(int) i){}
}
class B: A
{
override void foo(int i){}
}
int main()
{
auto b = new B;
b.foo(tuple(5));
}
This fails to compile. Why can't B use A's
On Thursday, 14 February 2013 at 00:29:51 UTC, cal wrote:
Should the following work?
import std.traits;
mixin template Foo()
{
void foo(T)(T t) if (isSomeString!T) {}
}
class A
{
void foo()(int i){}
mixin Foo;
}
void main()
{
auto a = new A;
a.foo("hello");
}
Error: templ
And a related question:
class A
{
void foo(int i){}
void foo(Tuple!(int) i){}
}
class B: A
{
override void foo(int i){}
}
int main()
{
auto b = new B;
b.foo(tuple(5));
}
This fails to compile. Why can't B use A's tuple overload of
foo()? If I do this:
class B: A
{
Should the following work?
import std.traits;
mixin template Foo()
{
void foo(T)(T t) if (isSomeString!T) {}
}
class A
{
void foo()(int i){}
mixin Foo;
}
void main()
{
auto a = new A;
a.foo("hello");
}
Error: template hello.A.foo does not match any function template
decla
12 matches
Mail list logo