Re: UFCS in generic libraries, silent hijacking, and compile errors.

2018-03-13 Thread aliak via Digitalmars-d-learn
On Sunday, 11 March 2018 at 15:24:31 UTC, Jonathan M Davis wrote: On Sunday, March 11, 2018 08:39:54 aliak via Digitalmars-d-learn wrote: On Saturday, 10 March 2018 at 23:00:07 UTC, Jonathan M Davis > issue in practice. That doesn't mean that it's never a > problem, but from what I've seen, it'

Re: UFCS in generic libraries, silent hijacking, and compile errors.

2018-03-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Sunday, March 11, 2018 08:39:54 aliak via Digitalmars-d-learn wrote: > On Saturday, 10 March 2018 at 23:00:07 UTC, Jonathan M Davis > > issue in practice. That doesn't mean that it's never a problem, > > but from what I've seen, it's very rarely a problem, and it's > > easy to work around if you

Re: UFCS in generic libraries, silent hijacking, and compile errors.

2018-03-11 Thread aliak via Digitalmars-d-learn
On Saturday, 10 March 2018 at 23:00:07 UTC, Jonathan M Davis wrote: The idea is that the type can provide its own version of the function that is better optimized for it - e.g. it could potentially provide a member function find that is more efficient for it than std.algorithm.searching.find.

Re: UFCS in generic libraries, silent hijacking, and compile errors.

2018-03-10 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, March 10, 2018 21:50:42 aliak via Digitalmars-d-learn wrote: > What are the recommended guidelines for using/not using UFCS in > writing generic libraries? > > I ask because if you have an internal generic free function that > you use on types in a generic algorithm via ufcs, then ever

UFCS in generic libraries, silent hijacking, and compile errors.

2018-03-10 Thread aliak via Digitalmars-d-learn
What are the recommended guidelines for using/not using UFCS in writing generic libraries? I ask because if you have an internal generic free function that you use on types in a generic algorithm via ufcs, then everything works fine until the type being operated on has a member function with