D 2015/2016 Vision?

Meta via Digitalmars-d digitalmars-d at puremagic.com
Mon Oct 5 13:02:11 PDT 2015


On Monday, 5 October 2015 at 19:43:54 UTC, bitwise wrote:
> also:
>
> // Error: can only synchronize on class objects, not 'Scoped'
> auto a1 = scoped!A("Foo");
> synchronized(a1) {}
>
> and also:
>
> // Error: template main.foo cannot deduce function from 
> argument types !()(Scoped)
> void foo(T)() if(is(T == A)) { }
> void main(string[] args) {
>     auto a1 = scoped!A("Foo");
>     foo(a1);
> }
>
>     Bit

This is more an issue with `alias this` than it is with `scoped`. 
Really, the issue I outlined is also due to `alias this` and its 
implicit conversion.


More information about the Digitalmars-d mailing list