Fix pair_sorter_finder for rstl::sort

This commit is contained in:
Henrique Gemignani Passos Lima 2022-12-24 01:41:50 -03:00
parent ea0198a1de
commit ca8366d5ee
2 changed files with 11 additions and 2 deletions

View File

@ -143,6 +143,8 @@ public:
/* { /* {
return cmp(a.first, b); return cmp(a.first, b);
}*/ }*/
bool operator()(const pair< K, V >& a, const pair< K, V >& b) const;
}; };
template <typename T> template <typename T>
@ -165,6 +167,12 @@ inline bool pair_sorter_finder< pair< K, V >, Cmp >::operator()(const pair< K, V
return cmp(a.first, b); return cmp(a.first, b);
} }
template < typename K, typename V, typename Cmp >
inline bool pair_sorter_finder< pair< K, V >, Cmp >::operator()(const pair< K, V >& a,
const pair< K, V >& b) const {
return cmp(a.first, b.first);
}
template < typename T > template < typename T >
typename T::const_iterator typename T::const_iterator
find_by_key(const T& container, find_by_key(const T& container,

View File

@ -65,8 +65,9 @@ CRasterFont::CRasterFont(CInputStream& in, IObjectStore* store)
rstl::pair< wchar_t, CGlyph >(chr, CGlyph(a, b, c, startU, startV, endU, endV, rstl::pair< wchar_t, CGlyph >(chr, CGlyph(a, b, c, startU, startV, endU, endV,
cellWidth, cellHeight, baseline, kernStart))); cellWidth, cellHeight, baseline, kernStart)));
} }
//rstl::sort(xc_glyphs.begin(), xc_glyphs.end(), rstl::sort(
// rstl::pair_sorter_finder< wchar_t, CGlyph, rstl::less< wchar_t > >()); xc_glyphs.begin(), xc_glyphs.end(),
rstl::default_pair_sorter_finder< rstl::vector< rstl::pair< wchar_t, CGlyph > > >());
} }
} }
} }