Chaining std.algorithm

monarch_dodra monarchdodra at gmail.com
Mon Dec 16 08:18:11 PST 2013


On Monday, 16 December 2013 at 04:45:40 UTC, John Carter wrote:
> When I try use find in map!"find!""" dmd whinges like crazy at 
> me.

First of all, you'd need to use:
map!`find!""`
, since you are nesting strings. As you wrote it, it looks like:

map!"find!" ~ ""

See the difference ?

Second, unfortunately, "find!pred" is not a standalone template. 
The signature is:
find(pred, Range, Args...)
If you write "just" "find!pred" dmd doesn't find your match. This 
is, IMO, a limitation and I am currently working on improving the 
situation.

To work around this, you need to make a "full" call. Use the 
lambda syntax, as suggested by H.S. Teoh.


More information about the Digitalmars-d-learn mailing list