http://d.puremagic.com/issues/show_bug.cgi?id=620


Alex Khmara <alex.khm...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |alex.khm...@gmail.com


--- Comment #4 from Alex Khmara <alex.khm...@gmail.com> 2011-01-01 22:22:42 PST 
---
(In reply to comment #3)
> Some hacking about showed me that opDispatch has a workaround for this 
> problem,
> by using a two-layer approach:
> 
> template opDispatch( string name ) {
>     auto opDispatch( T... )( T args ) {
>         // Do something!
>     }
> }

This workaroung is only partial. This code produces "Error: s.opDispatch(T...)
has no value".

import std.stdio;

struct S {
    template opDispatch( string name ) {
        string opDispatch( T... )( T args ) {
            return "bar";
        }
    }
}

void main() {
    S s;
    string str = s.foo;
}

Same if I try "auto opDispatch" instead of "string".

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to