]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Sync string_view definition in lmdb-safe
authorRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 21 Sep 2020 07:11:07 +0000 (09:11 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Mon, 21 Sep 2020 07:11:07 +0000 (09:11 +0200)
While we do not actually care about string_view::at() in lmdb-safe,
we need to keep the two in sync so the type aliases do not collide.
Perhaps we should consider using pdns_string_view as an alias instead?

ext/lmdb-safe/lmdb-safe.hh

index 16d150fa7d6112e4f1d276f28da6a1d9acd8e4d3..89a85ece6f11a470077c1fef2e68b900b8ee4ea2 100644 (file)
 using std::string_view;
 #else
 #include <boost/version.hpp>
-#if BOOST_VERSION >= 106100
+#if BOOST_VERSION >= 106400
+// string_view already exists in 1.61.0 but string_view::at() is not usable with modern compilers, see:
+// https://github.com/boostorg/utility/pull/26
 #include <boost/utility/string_view.hpp>
 using boost::string_view;
-#else
+#elif BOOST_VERSION >= 105300
 #include <boost/utility/string_ref.hpp>
 using string_view = boost::string_ref;
+#else
+using string_view = std::string;
 #endif
 #endif