digitalmars.D - Why does phobos have collisions?
- Mike B Johnson (14/14) Jun 07 2017 Error: template std.algorithm.mutation.strip cannot deduce
- Dukc (10/13) Jun 07 2017 What do you mean with "standard strip"? In my vocabulary,
- Dukc (5/7) Jun 07 2017 Judging by that you correctly passed a string to strip, but did
- Ivan Kazmenko (9/23) Jun 07 2017 Actually, it looks like the std.algorithm[.mutation] is imported
- drug (2/29) Jun 07 2017 Selective imports are good in this case.
Error: template std.algorithm.mutation.strip cannot deduce function from argument types !()(string), candidates are: src\phobos\std\algorithm\mutation.d(2280): std.algorithm.mutation.strip(Range, E)(Range range, E element) if (isBidirectionalRange!Range && is(typeof(range.front == element) : bool)) \src\phobos\std\algorithm\mutation.d(2287): std.algorithm.mutation.strip(alias pred, Range)(Range range) if (isBidirectionalRange!Range && is(typeof(pred(range.back)) : bool)) This is on a line of code that simply strips away a string... and works fine when using standard strip(without importing std.algorithm)... but when importing std.algorithm too, those errors pop up... seems like a defect.
Jun 07 2017
On Wednesday, 7 June 2017 at 10:01:30 UTC, Mike B Johnson wrote:and works fine when using standard strip(without importing std.algorithm)... but when importing std.algorithm too, those errors pop up... seems like a defect.What do you mean with "standard strip"? In my vocabulary, functions in std.algorithm ARE the standard ones. It is not a name clash. If it were, the compiler would announce "ambiquous name lookup" or something like that. The error you have tells that none of the names fit, not that many of them did. Yes, the name matched, but the static types of arguments (either compile-time or runtime) you passed did not. I think you should copy here what you wote, so we can get a better picture where the problem is.
Jun 07 2017
On Wednesday, 7 June 2017 at 10:01:30 UTC, Mike B Johnson wrote:template std.algorithm.mutation.strip cannot deduce function from argument types !()(string)Judging by that you correctly passed a string to strip, but did not specify what to strip from it. You can either specify an example of characters you want to strip off, or an alias predicate which judges whether an element should go.
Jun 07 2017
On Wednesday, 7 June 2017 at 10:01:30 UTC, Mike B Johnson wrote:Error: template std.algorithm.mutation.strip cannot deduce function from argument types !()(string), candidates are: src\phobos\std\algorithm\mutation.d(2280): std.algorithm.mutation.strip(Range, E)(Range range, E element) if (isBidirectionalRange!Range && is(typeof(range.front == element) : bool)) \src\phobos\std\algorithm\mutation.d(2287): std.algorithm.mutation.strip(alias pred, Range)(Range range) if (isBidirectionalRange!Range && is(typeof(pred(range.back)) : bool)) This is on a line of code that simply strips away a string... and works fine when using standard strip(without importing std.algorithm)... but when importing std.algorithm too, those errors pop up... seems like a defect.Actually, it looks like the std.algorithm[.mutation] is imported but std.string isn't. As std.algorithm's strip is more generic, it cannot assume what's the "whitespace" to be stripped, so it's not callable without explicitly specifying what to strip. I've experienced this too, and it's really a bit confusing the first time it happens. Ivan Kazmenko.
Jun 07 2017
07.06.2017 17:57, Ivan Kazmenko пишет:On Wednesday, 7 June 2017 at 10:01:30 UTC, Mike B Johnson wrote:Selective imports are good in this case.Error: template std.algorithm.mutation.strip cannot deduce function from argument types !()(string), candidates are: src\phobos\std\algorithm\mutation.d(2280): std.algorithm.mutation.strip(Range, E)(Range range, E element) if (isBidirectionalRange!Range && is(typeof(range.front == element) : bool)) \src\phobos\std\algorithm\mutation.d(2287): std.algorithm.mutation.strip(alias pred, Range)(Range range) if (isBidirectionalRange!Range && is(typeof(pred(range.back)) : bool)) This is on a line of code that simply strips away a string... and works fine when using standard strip(without importing std.algorithm)... but when importing std.algorithm too, those errors pop up... seems like a defect.Actually, it looks like the std.algorithm[.mutation] is imported but std.string isn't. As std.algorithm's strip is more generic, it cannot assume what's the "whitespace" to be stripped, so it's not callable without explicitly specifying what to strip. I've experienced this too, and it's really a bit confusing the first time it happens. Ivan Kazmenko.
Jun 07 2017