[Issue 9272] opDispatch conflicts with UFCS on template functions

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Jan 5 09:12:17 PST 2013


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



--- Comment #3 from Kenji Hara <k.hara.pg at gmail.com> 2013-01-05 09:12:16 PST ---
(In reply to comment #2)
> (In reply to comment #1)
> > opDispatch takes precedence and just fails to compile.
> 
> Obviously. But is it really by design?
> 
> This works, where opDispatch does not take precedence:
> ---
> struct Foo {
>     void opDispatch(string s)() {}
> }
> 
> void baz(Foo f) {}
> 
> unittest {
>     Foo foo;
>     foo.baz();     // OK
> }
> ---

Just *template* opDispach is required for operator overloading. Therefore
non-template function is simply ignored.

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


More information about the Digitalmars-d-bugs mailing list