Since maximum(itr) supports generators, argmax(itr) should too


#1

I noticed that maximum(i for i = 1:10) works but argmax(i for i=1:10) does not. Any reason for the inconsistency?

Right now, I work around this by writing argmax([i for i=1:10]), but I think supporting the generator syntax is desirable to avoid a temporary array. Thanks!


#2

Likewise, a good idea.


#3

I’ve filed an issue for this. I’ll have a look at how maximum does it and see if it’s obvious what needs to be done here. Thanks for the encouragement!