Simen kjaeraas wrote:
> Adam Burton wrote:
>
>> I looked into alias this and it does indeed work, unless the alias is to
>> a
>> function. That has been reported as a bug though
>> http://d.puremagic.com/issues/show_bug.cgi?id=2814
>
> Wouldn't that be the opposite of what you were discussing e
Adam Burton wrote:
I looked into alias this and it does indeed work, unless the alias is to
a
function. That has been reported as a bug though
http://d.puremagic.com/issues/show_bug.cgi?id=2814
Wouldn't that be the opposite of what you were discussing earlier?
alias this lets a struct behav
Jonathan M Davis wrote:
> On Tuesday, November 09, 2010 15:48:27 Adam Burton wrote:
>> Hi,
>> should the below work?
>>
>> struct A
>> {
>> public this(B b) {}
>> }
>>
>> struct B {}
>>
>> void foo(A a) {}
>>
>> void main()
>> {
>> B b;
>> foo(b); // Fails
>> }
>>
>> The const
Adam Burton wrote:
True, I had thought of that, but I figured in that situation it would
favour
int over foo (in same way long vs int) so to access foo you'd need to
explicitly use the constructor. On the other hand I suppose its more of a
difficult decision when you hit something like below
On Tuesday, November 09, 2010 15:48:27 Adam Burton wrote:
> Hi,
> should the below work?
>
> struct A
> {
> public this(B b) {}
> }
>
> struct B {}
>
> void foo(A a) {}
>
> void main()
> {
> B b;
> foo(b); // Fails
> }
>
> The constructor parameter doesn't need to be a struct,
On 09/11/2010 23:57, Simen kjaeraas wrote:
Adam Burton wrote:
Hi,
should the below work?
struct A
{
public this(B b) {}
}
struct B {}
void foo(A a) {}
void main()
{
B b;
foo(b); // Fails
}
The constructor parameter doesn't need to be a struct, it could be an
int.
The workaround is to expl
Simen kjaeraas wrote:
> Adam Burton wrote:
>
>> Hi,
>> should the below work?
>>
>> struct A
>> {
>> public this(B b) {}
>> }
>>
>> struct B {}
>>
>> void foo(A a) {}
>>
>> void main()
>> {
>> B b;
>> foo(b); // Fails
>> }
>>
>> The constructor parameter doesn't need to be a stru
Adam Burton wrote:
Hi,
should the below work?
struct A
{
public this(B b) {}
}
struct B {}
void foo(A a) {}
void main()
{
B b;
foo(b); // Fails
}
The constructor parameter doesn't need to be a struct, it could be an
int.
The workaround is to explicity call the constructo
Hi,
should the below work?
struct A
{
public this(B b) {}
}
struct B {}
void foo(A a) {}
void main()
{
B b;
foo(b); // Fails
}
The constructor parameter doesn't need to be a struct, it could be an int.
The workaround is to explicity call the constructor.