Trouble with destroy

Jonathan M Davis jmdavisProg at gmx.com
Mon Sep 23 22:51:32 PDT 2013


On Monday, September 23, 2013 22:45:33 H. S. Teoh wrote:
> On Tue, Sep 24, 2013 at 05:18:38AM +0200, Meta wrote:
> > On Monday, 23 September 2013 at 19:11:53 UTC, Namespace wrote:
> > >As always. As soon as you wrote it, you've got the solution.
> > >----
> > >destroy!A(a);
> > >----
> > 
> > This still seems like it should be worth reporting. I can't
> > remember... Is partial ordering done between multiple matching
> > template functions like it is with regular functions? If so, there
> > should be no ambiguity in choosing the second one.
> 
> IIRC, D templates don't have best-match like C++ does; it was an
> explicit design choice that multiple matching templates is an error.

Correct. For IFTI to work, the arguments need to pass exactly one of the 
overloads' template constraints. If they pass the template constraints for 
multiple overloads, then it's an ambiguity error. There is no attempt to figure 
out which matches "better."

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list