Passing variables, preserving UDAs: A Gripe

Nick Sabalausky via Digitalmars-d digitalmars-d at puremagic.com
Wed Feb 8 10:00:25 PST 2017


On 02/08/2017 07:38 AM, Kagamin wrote:
> try this:
> void main()
> {
>      auto foo = new Foo();
>      doStuff!(Foo.s);
> }

Same result:
Error: need 'this' for 'doStuff' of type 'pure nothrow @nogc @safe void()'

But even if that did compile, it still wouldn't work because doStuff 
wouldn't be able to access "foo.s" since "foo" isn't getting passed in 
in any way.



More information about the Digitalmars-d mailing list