From c9b1d15ebe7aaa05ccb62cc4bbb5b47fd784ef62 Mon Sep 17 00:00:00 2001 From: Alexander van Gessel Date: Wed, 22 Nov 2017 15:48:42 +0100 Subject: [PATCH] Bump minimum boost version for external string_view --- src/serialization/string_view.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/serialization/string_view.hpp b/src/serialization/string_view.hpp index e530b7b8b87a0..af9afa87c4d21 100644 --- a/src/serialization/string_view.hpp +++ b/src/serialization/string_view.hpp @@ -21,7 +21,14 @@ that class. */ #include -#if BOOST_VERSION > 106100 +/* + * Boost 1.61 already has string_view, but it fails to compile on some compilers. + * The problem is that in string_view::at's ternary expression, + * BOOST_THROW_EXCEPTION is not seen as a throw-expression. If a ternary branch + * is not a throw-expression, it must be of the same type as the other branch, + * necessitating the ', res[0]' workaround. + */ +#if BOOST_VERSION > 106400 /* Boost string_view is available, so we can just use it. */ #include