Add data() member to float128

This commit is contained in:
Matt Borland
2026-04-30 14:48:10 -04:00
parent d6de341b8e
commit 4bcbc70a44
3 changed files with 31 additions and 0 deletions
@@ -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)
+1
View File
@@ -1281,6 +1281,7 @@ test-suite misc :
[ run git_issue_636.cpp : : : [ check-target-builds ../config//has_float128 : <source>quadmath : <build>no ] ]
[ run git_issue_652.cpp ]
[ run git_issue_734.cpp ]
[ run git_issue_743.cpp : : : [ check-target-builds ../config//has_float128 : <source>quadmath : <build>no ] ]
[ run git_issue_759.cpp : : : [ check-target-builds ../config//has_float128 : <source>quadmath : <build>no ] ]
[ compile git_issue_98.cpp :
[ check-target-builds ../config//has_float128 : <define>TEST_FLOAT128 <source>quadmath : ]
+22
View File
@@ -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 <boost/multiprecision/float128.hpp>
#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();
}