Boost.Locale
boost::locale::comparator< CharType, default_level > Struct Template Reference

This class can be used in STL algorithms and containers for comparison of strings with a level other than identical. More...

#include <boost/locale/collator.hpp>

Public Member Functions

 comparator (const std::locale &l=std::locale(), collate_level level=default_level)
 
bool operator() (const std::basic_string< CharType > &left, const std::basic_string< CharType > &right) const
 Compare two strings – equivalent to return left < right according to collation rules.
 

Detailed Description

template<typename CharType, collate_level default_level = collate_level::identical>
struct boost::locale::comparator< CharType, default_level >

This class can be used in STL algorithms and containers for comparison of strings with a level other than identical.

For example:

std::map<std::string,std::string,comparator<char,collate_level::secondary> > data;

Would create a map the keys of which are sorted using secondary collation level

Constructor & Destructor Documentation

◆ comparator()

template<typename CharType , collate_level default_level = collate_level::identical>
boost::locale::comparator< CharType, default_level >::comparator ( const std::locale &  l = std::locale(),
collate_level  level = default_level 
)
inline

Create a comparator class for locale l and with collation level level

Exceptions
std::bad_castl does not have collator facet installed

The documentation for this struct was generated from the following file: