View mode: basic / threaded / horizontal-split · Log in · Help
May 07, 2012
Re: Ref / NotNull struct
On Monday, 7 May 2012 at 18:46:55 UTC, Chris Cain wrote:
> OK, I tried a few things, but something that I think might need 
> some attention: UFCS is very problematic with this.
>
> https://gist.github.com/6198938b9c6d40a53ca1

But apart from that, nor anything else that does not work? :)
May 07, 2012
Re: Ref / NotNull struct
On Monday, 7 May 2012 at 19:36:52 UTC, Namespace wrote:
> But apart from that, nor anything else that does not work? :)

I put together a few toy examples with it and it seems to work in 
general otherwise. It might be better if someone has a larger 
project that they wanted a non-null reference for to get a lot of 
code tested all at once. Overall, I'm pretty happy with it as 
long as I don't use UFCS with it.

Again, thanks for your efforts developing it :)
May 08, 2012
Re: Ref / NotNull struct
On Monday, 7 May 2012 at 21:10:17 UTC, Chris Cain wrote:
> On Monday, 7 May 2012 at 19:36:52 UTC, Namespace wrote:
>> But apart from that, nor anything else that does not work? :)
>
> I put together a few toy examples with it and it seems to work 
> in general otherwise. It might be better if someone has a 
> larger project that they wanted a non-null reference for to get 
> a lot of code tested all at once. Overall, I'm pretty happy 
> with it as long as I don't use UFCS with it.
>
> Again, thanks for your efforts developing it :)

Not at all, it was my pleasure. I'm sure you and perhaps others 
will find a few criticisms that can be fixed.

But I have noticed again, that in almost all functions/methods of 
"Proxy" in std.typecons the "inout" is missing. Maybe i should 
open a Bug Report for this.
May 08, 2012
Re: Ref / NotNull struct
On Tuesday, 8 May 2012 at 16:27:27 UTC, Namespace wrote:
> On Monday, 7 May 2012 at 21:10:17 UTC, Chris Cain wrote:
>> On Monday, 7 May 2012 at 19:36:52 UTC, Namespace wrote:
>>> But apart from that, nor anything else that does not work? :)
>>
>> I put together a few toy examples with it and it seems to work 
>> in general otherwise. It might be better if someone has a 
>> larger project that they wanted a non-null reference for to 
>> get a lot of code tested all at once. Overall, I'm pretty 
>> happy with it as long as I don't use UFCS with it.
>>
>> Again, thanks for your efforts developing it :)
>
> Not at all, it was my pleasure. I'm sure you and perhaps others 
> will find a few criticisms that can be fixed.
>
> But I have noticed again, that in almost all functions/methods 
> of "Proxy" in std.typecons the "inout" is missing. Maybe i 
> should open a Bug Report for this.

Another Bug:
If you try to cast a const Ref to his normal object like this

void foo(const Ref!(Foo) rf) {
    Foo f = cast(Foo) rf;
}

you get this error

"ref_test.d(121): Error: template 
ref_test.Ref!(Foo).Ref.Proxy!(_obj).opCast does
 not match any function template declaration
D:\D\dmd2\windows\bin\..\..\src\phobos\std\typecons.d(2796): 
Error: template ref
_test.Ref!(Foo).Ref.Proxy!(_obj).opCast(T,this X) cannot deduce 
template functio
n from argument types !(Foo)()"

After i changed line 2796 and made the opCast method "inout" it 
works as i want.
Next ›   Last »
1 2
Top | Discussion index | About this forum | D home