On Tuesday, 27 February 2018 at 21:04:59 UTC, ag0aep6g wrote:
On 02/27/2018 09:59 PM, Radu wrote:
On Tuesday, 27 February 2018 at 20:51:25 UTC, ag0aep6g wrote:
On 02/27/2018 09:30 PM, Radu wrote:
[...]
[...]
[...]
So the bug is that somehow the templated version makes it so
there is an impl
On 2/27/18 3:59 PM, Radu wrote:
On Tuesday, 27 February 2018 at 20:51:25 UTC, ag0aep6g wrote:
On 02/27/2018 09:30 PM, Radu wrote:
enum Type { a };
struct S(Type t = Type.a)
{
this(Type)(Type t)
{
import std.stdio;
writeln("ctor called.");
}
}
void main()
{
On 02/27/2018 09:59 PM, Radu wrote:
On Tuesday, 27 February 2018 at 20:51:25 UTC, ag0aep6g wrote:
On 02/27/2018 09:30 PM, Radu wrote:
[...]
enum Type { a };
struct S(Type t = Type.a)
{
this(Type)(Type t)
{
import std.stdio;
writeln("ctor called.");
}
}
[...]
S
On Tuesday, 27 February 2018 at 20:51:25 UTC, ag0aep6g wrote:
On 02/27/2018 09:30 PM, Radu wrote:
enum Type { a };
struct S(Type t = Type.a)
{
this(Type)(Type t)
{
import std.stdio;
writeln("ctor called.");
}
}
void main()
{
auto x = S!(Type.a)(Type.a);
On 02/27/2018 09:30 PM, Radu wrote:
enum Type { a };
struct S(Type t = Type.a)
{
this(Type)(Type t)
{
import std.stdio;
writeln("ctor called.");
}
}
void main()
{
auto x = S!(Type.a)(Type.a);
void* y = &x;
auto z = (cast(S!(Type.a)) y);
}
Surpris
I have this:
enum Type { a };
struct S(Type t = Type.a)
{
this(Type)(Type t)
{
import std.stdio;
writeln("ctor called.");
}
}
void main()
{
auto x = S!(Type.a)(Type.a);
void* y = &x;
auto z = (cast(S!(Type.a)) y);
}
Surprisingly the cast will actually c