[Issue 9272] opDispatch conflicts with UFCS on template functions

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


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



--- Comment #4 from Nicolas Sicard <dransic at gmail.com> 2013-01-05 09:17:39 PST ---
(In reply to comment #3)
> (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.

Yes. I understand why it doen't work at the moment. I just found it
inconsistent. Maybe this should be an enhancement request then...

-- 
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