Re: Another bug?

2017-01-30 Thread Yuxuan Shui via Digitalmars-d-learn
On Monday, 30 January 2017 at 12:40:44 UTC, Jack Applegame wrote: bug report: https://issues.dlang.org/show_bug.cgi?id=17128 LDC (2.070.2) has a different problem: the dtor is never called.

Re: Another bug?

2017-01-30 Thread Jack Applegame via Digitalmars-d-learn
bug report: https://issues.dlang.org/show_bug.cgi?id=17128

Re: Another bug?

2017-01-30 Thread ag0aep6g via Digitalmars-d-learn
On 01/30/2017 12:55 PM, Jack Applegame wrote: Code: import std.stdio; struct Foo { int val = 0; ~this() { writefln("destruct %s", val); } } void bar(ARGS...)() { ARGS args; args[0].val = 1; writefln("val = %s", args[0].val); } void main() { bar!Foo(); }

Re: Another bug?

2017-01-30 Thread Jack Applegame via Digitalmars-d-learn
WORKAROUND: import std.stdio; struct Foo { int val = 0; ~this() { writefln("destruct %s", val); } } void bar(ARGS...)() { struct Tuple { ARGS args; alias args this; } Tuple args; args[0].val = 1; writefln("val = %s", args[0].val); }

Another bug?

2017-01-30 Thread Jack Applegame via Digitalmars-d-learn
Code: import std.stdio; struct Foo { int val = 0; ~this() { writefln("destruct %s", val); } } void bar(ARGS...)() { ARGS args; args[0].val = 1; writefln("val = %s", args[0].val); } void main() { bar!Foo(); } Excpected output: val = 1 destruct 1 But

Another bug in function overloading?

2014-04-26 Thread Domain via Digitalmars-d-learn
module test; public interface I { void foo(); void foo(int); } public abstract class A : I { public void bar() { foo(); } public void foo(int i) { } } public class C : A { public void foo() { } public void bar2() { foo(1);

Re: Another bug in function overloading?

2014-04-26 Thread Jonathan M Davis via Digitalmars-d-learn
On Sat, 26 Apr 2014 06:55:38 + Domain via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: module test; public interface I { void foo(); void foo(int); } public abstract class A : I { public void bar() { foo(); } public

Re: Another bug in function overloading?

2014-04-26 Thread Andrej Mitrovic via Digitalmars-d-learn
On 4/26/14, Jonathan M Davis via Digitalmars-d-learn digitalmars-d-learn@puremagic.com wrote: No. That's expected. I wonder whether a better diagnostic could help. But then again, maybe the hiding would be intentional and the diagnostic would be spurious/invalid. Not sure..

Strange behaviour in templates (Another bug?)

2011-11-11 Thread Tobias Pankrath
I'm trying to learn template meta programming in D. To do this, I'm working on a meta state machine like Boost.MSM (http://www.boost.org/doc/libs/1_47_0/libs/msm/doc/HTML/index.html). States are types and can have sub states. If they do, they need to have an attribut 'SubStates', which should