mixing array and string .find()
Jarrett Billingsley
jarrett.billingsley at gmail.com
Mon Mar 23 18:11:52 PDT 2009
On Mon, Mar 23, 2009 at 8:11 PM, Brian <digitalmars at brianguertin.com> wrote:
> is it possible to write a generic .find function for arrays that ignores
> strings and so doesn't cause conflicts? I think in D2 its easy by putting
> an if() constraint on the template, but is it possible in D1? like:
D2's overload sets would help here more than an if() constraint. But
even still, it might be ambiguous.
You don't actually have to import one statically. Just alias the one
you want to take precedence in the current module:
import std.string;
import my.templates;
alias my.templates.find find;
Now whenever you use 'find' it will use my.templates.find.
More information about the Digitalmars-d-learn
mailing list