]> git.donarmstrong.com Git - lilypond.git/commitdiff
Remove default comparison for binary search
authorGraham Percival <graham@percival-music.ca>
Thu, 8 Dec 2011 11:07:50 +0000 (03:07 -0800)
committerGraham Percival <graham@percival-music.ca>
Wed, 14 Dec 2011 09:51:06 +0000 (01:51 -0800)
clang++ complains about this, and we never rely on the default
comparison in our code.

/home/gperciva/src/lilypond/flower/include/std-vector.hh:197:36:
error: 'T' does
      not refer to a value
               Compare less = less<T> (),
                                   ^
/home/gperciva/src/lilypond/flower/include/std-vector.hh:193:19:
note: declared
      here
template<typename T, typename Compare>
                  ^
/home/gperciva/src/lilypond/flower/include/std-vector.hh:197:40:
error:
      expected expression
               Compare less = less<T> (),

flower/include/std-vector.hh

index 48b34f12ed90ddc6a777a5c9d03ce2ded9bff6cb..020403aea12bac1cf285028807a830a03e4dc60c 100644 (file)
@@ -194,7 +194,7 @@ template<typename T, typename Compare>
 vsize
 binary_search (vector<T> const &v,
                T const &key,
-               Compare less = less<T> (),
+               Compare less,
                vsize b = 0, vsize e = VPOS)
 {
   vsize lb = lower_bound (v, key, less, b, e);