Dekel Tsur <[EMAIL PROTECTED]> writes:

| Use
| struct compare_formats {
|      bool operator()(Format const & a, Format const & b) {
|         return a.name < b.name;
|      }
| }
| 
| and then
|     sort(formats_vec.begin(), formats_vec.end(), compare_formats());
| 
| PS Is there a template for simplfying this ?


Yes, less<>  (e.g. less(Format>())

Does sort take a function returning bool or one returning int? (-1
less than 0 = equal 1  greater than)?

        Lgb

Reply via email to