From 4bcbc70a44c4a1759466d08f7e5ec76e2e74d40f Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 30 Apr 2026 14:48:10 -0400 Subject: [PATCH 1/2] Add `data()` member to float128 --- include/boost/multiprecision/float128.hpp | 8 ++++++++ test/Jamfile.v2 | 1 + test/git_issue_743.cpp | 22 ++++++++++++++++++++++ 3 files changed, 31 insertions(+) create mode 100644 test/git_issue_743.cpp diff --git a/include/boost/multiprecision/float128.hpp b/include/boost/multiprecision/float128.hpp index 378e2ced2..6b544e758 100644 --- a/include/boost/multiprecision/float128.hpp +++ b/include/boost/multiprecision/float128.hpp @@ -296,6 +296,14 @@ struct float128_backend { return m_value; } + BOOST_MP_CXX14_CONSTEXPR float128_type& data() + { + return m_value; + } + BOOST_MP_CXX14_CONSTEXPR const float128_type& data() const + { + return m_value; + } }; inline BOOST_MP_CXX14_CONSTEXPR void eval_add(float128_backend& result, const float128_backend& a) diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index ba8eb4c14..1feb0bcc1 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -1281,6 +1281,7 @@ test-suite misc : [ run git_issue_636.cpp : : : [ check-target-builds ../config//has_float128 : quadmath : no ] ] [ run git_issue_652.cpp ] [ run git_issue_734.cpp ] + [ run git_issue_743.cpp : : : [ check-target-builds ../config//has_float128 : quadmath : no ] ] [ run git_issue_759.cpp : : : [ check-target-builds ../config//has_float128 : quadmath : no ] ] [ compile git_issue_98.cpp : [ check-target-builds ../config//has_float128 : TEST_FLOAT128 quadmath : ] diff --git a/test/git_issue_743.cpp b/test/git_issue_743.cpp new file mode 100644 index 000000000..19d5bfd76 --- /dev/null +++ b/test/git_issue_743.cpp @@ -0,0 +1,22 @@ +/////////////////////////////////////////////////////////////////////////////// +// Copyright 2026 Matt Borland. Distributed under 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) +// +// See: https://github.com/boostorg/multiprecision/issues/743 + +#include +#include "test.hpp" + +int main() +{ + using real = boost::multiprecision::float128; + + constexpr real value {5}; + BOOST_CHECK(value.backend().value() == value.backend().data()); + + real mutable_value {42}; + BOOST_CHECK(mutable_value.backend().value() == mutable_value.backend().data()); + + return boost::report_errors(); +} \ No newline at end of file From 9bd84a2ba8de04bf0dbb7f5529c8ca41c05b862d Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Thu, 30 Apr 2026 15:11:07 -0400 Subject: [PATCH 2/2] Fix missing newline --- test/git_issue_743.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/git_issue_743.cpp b/test/git_issue_743.cpp index 19d5bfd76..39cb41f27 100644 --- a/test/git_issue_743.cpp +++ b/test/git_issue_743.cpp @@ -19,4 +19,4 @@ int main() BOOST_CHECK(mutable_value.backend().value() == mutable_value.backend().data()); return boost::report_errors(); -} \ No newline at end of file +}