Lars Gullik Bjønnes wrote: > | struct CompareKey { > | bool operator()(XPMmap const & lhs, XPMmap const & rhs) { > | return strcmp(lhs.key, rhs.key) < 0; > | } > > | bool operator()(XPMmap const & lhs, string const & rhs) { > | return strcmp(lhs.key, rhs.c_str()) < 0; > | } > > We have a compare function in lyx::support for this. lstrings.h
??? For comparison bewteen XPMmap::key and a string? How? > | XPMmap unsorted_xpm_map[] = ... > sort it. > Check that the map is sorted, and if not assert. > (is_sorted in lyx::support somewhere.) Ok. (I trust that that's 'sorted' in lyxalgo.h?) A bit of trial and error needed but easy to do. Thanks for the feedback. -- Angus