[Bro-Dev] Where did the min() function go?

Jonathan Siwek jsiwek at ncsa.illinois.edu
Sun May 8 18:34:05 PDT 2011


> min() is an STL algorithm. But I guess that means that
> #include <algorithm> should now be added to util.h, right? (that's
> where the min functions used to live)

It might just be my personal style, but I like it when source files include all headers it requires and no more; not requiring some include cascade to get things to work.  And I don't think util.h has any dependence on <algorithm>, so I'd say just add <algorithm> to files that generate compile errors because it's missing as you find them.

There was another issue going on with using the templated std::min() with args of differing types that I address in commit 35b7caf44fdb045e2e729cfbf6f84fde707985db

- Jon


More information about the bro-dev mailing list