Compatibility with Boost 1.81's locale changes

The collector_base class has been deprecated in Boost 1.81, and we're compiling
with Werror on the Windows CI so it needs an immediate fix for the new vcpkg.
This commit is contained in:
Steve Cotton 2023-01-17 12:47:37 +01:00 committed by Steve Cotton
parent 04cedaba2e
commit bc7b177332

View File

@ -537,8 +537,13 @@ int icompare(const std::string& s1, const std::string& s2)
std::scoped_lock lock(get_mutex());
try {
#if BOOST_VERSION < 108100
return std::use_facet<bl::collator<char>>(get_manager().get_locale()).compare(
bl::collator_base::secondary, s1, s2);
#else
return std::use_facet<bl::collator<char>>(get_manager().get_locale()).compare(
bl::collate_level::secondary, s1, s2);
#endif
} catch(const std::bad_cast&) {
static bool bad_cast_once = false;