c++boostboost-range

why does `boost::lower_bound` take its argument by value?


The implementation of boost::lower_bound (found here) in Range 2.0 takes its argument by value.

Why is this? std::lower_bound takes its argument by const ref - see here


Solution

  • This has now been fixed by this issue.

    There may be historical reasons for taking the argument by value. See this answer about function objects passed by value to standard algorithms.