From 19fcec84d8d7d21e796c7624e521b60d28ee21ed Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 20:45:59 +0200 Subject: Adding upstream version 16.2.11+ds. Signed-off-by: Daniel Baumann --- .../multiprecision/test/test_optional_compat.cpp | 31 ++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/boost/libs/multiprecision/test/test_optional_compat.cpp (limited to 'src/boost/libs/multiprecision/test/test_optional_compat.cpp') diff --git a/src/boost/libs/multiprecision/test/test_optional_compat.cpp b/src/boost/libs/multiprecision/test/test_optional_compat.cpp new file mode 100644 index 000000000..4626f9ccd --- /dev/null +++ b/src/boost/libs/multiprecision/test/test_optional_compat.cpp @@ -0,0 +1,31 @@ +/* + * (c) Copyright Andrey Semashev 2018. + * + * Use, modification and distribution are subject to the + * Boost Software License, Version 1.0. (See accompanying file + * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) + */ +/* + * The test verifies that Boost.Multiprecision does not cause conflict with Boost.Optional + * because of its restricted conversion constructors and operators. See comments in: + * + * https://github.com/boostorg/integer/pull/11 + */ + +#include +#include +#include + +inline boost::optional foo() +{ + return boost::optional(10); +} + +int main() +{ + boost::optional num = foo(); + BOOST_TEST(!!num); + BOOST_TEST(*num == 10); + + return boost::report_errors(); +} -- cgit v1.2.3