summaryrefslogtreecommitdiff
path: root/boost/math/tools/fraction.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'boost/math/tools/fraction.hpp')
-rw-r--r--boost/math/tools/fraction.hpp18
1 files changed, 13 insertions, 5 deletions
diff --git a/boost/math/tools/fraction.hpp b/boost/math/tools/fraction.hpp
index b245ddd2a3..a787c603f3 100644
--- a/boost/math/tools/fraction.hpp
+++ b/boost/math/tools/fraction.hpp
@@ -33,11 +33,11 @@ namespace detail
typedef typename Gen::result_type result_type;
typedef typename Gen::result_type value_type;
- static result_type a(const value_type&)
+ static result_type a(const value_type&) BOOST_MATH_NOEXCEPT(value_type)
{
return 1;
}
- static result_type b(const value_type& v)
+ static result_type b(const value_type& v) BOOST_MATH_NOEXCEPT(value_type)
{
return v;
}
@@ -49,11 +49,11 @@ namespace detail
typedef typename Gen::result_type value_type;
typedef typename value_type::first_type result_type;
- static result_type a(const value_type& v)
+ static result_type a(const value_type& v) BOOST_MATH_NOEXCEPT(value_type)
{
return v.first;
}
- static result_type b(const value_type& v)
+ static result_type b(const value_type& v) BOOST_MATH_NOEXCEPT(value_type)
{
return v.second;
}
@@ -85,7 +85,8 @@ namespace detail
// Note that the first a0 returned by generator Gen is disarded.
//
template <class Gen, class U>
-inline typename detail::fraction_traits<Gen>::result_type continued_fraction_b(Gen& g, const U& factor, boost::uintmax_t& max_terms)
+inline typename detail::fraction_traits<Gen>::result_type continued_fraction_b(Gen& g, const U& factor, boost::uintmax_t& max_terms)
+ BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename detail::fraction_traits<Gen>::result_type) && noexcept(std::declval<Gen>()()))
{
BOOST_MATH_STD_USING // ADL of std names
@@ -126,6 +127,7 @@ inline typename detail::fraction_traits<Gen>::result_type continued_fraction_b(G
template <class Gen, class U>
inline typename detail::fraction_traits<Gen>::result_type continued_fraction_b(Gen& g, const U& factor)
+ BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename detail::fraction_traits<Gen>::result_type) && noexcept(std::declval<Gen>()()))
{
boost::uintmax_t max_terms = (std::numeric_limits<boost::uintmax_t>::max)();
return continued_fraction_b(g, factor, max_terms);
@@ -133,6 +135,7 @@ inline typename detail::fraction_traits<Gen>::result_type continued_fraction_b(G
template <class Gen>
inline typename detail::fraction_traits<Gen>::result_type continued_fraction_b(Gen& g, int bits)
+ BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename detail::fraction_traits<Gen>::result_type) && noexcept(std::declval<Gen>()()))
{
BOOST_MATH_STD_USING // ADL of std names
@@ -146,6 +149,7 @@ inline typename detail::fraction_traits<Gen>::result_type continued_fraction_b(G
template <class Gen>
inline typename detail::fraction_traits<Gen>::result_type continued_fraction_b(Gen& g, int bits, boost::uintmax_t& max_terms)
+ BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename detail::fraction_traits<Gen>::result_type) && noexcept(std::declval<Gen>()()))
{
BOOST_MATH_STD_USING // ADL of std names
@@ -172,6 +176,7 @@ inline typename detail::fraction_traits<Gen>::result_type continued_fraction_b(G
//
template <class Gen, class U>
inline typename detail::fraction_traits<Gen>::result_type continued_fraction_a(Gen& g, const U& factor, boost::uintmax_t& max_terms)
+ BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename detail::fraction_traits<Gen>::result_type) && noexcept(std::declval<Gen>()()))
{
BOOST_MATH_STD_USING // ADL of std names
@@ -213,6 +218,7 @@ inline typename detail::fraction_traits<Gen>::result_type continued_fraction_a(G
template <class Gen, class U>
inline typename detail::fraction_traits<Gen>::result_type continued_fraction_a(Gen& g, const U& factor)
+ BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename detail::fraction_traits<Gen>::result_type) && noexcept(std::declval<Gen>()()))
{
boost::uintmax_t max_iter = (std::numeric_limits<boost::uintmax_t>::max)();
return continued_fraction_a(g, factor, max_iter);
@@ -220,6 +226,7 @@ inline typename detail::fraction_traits<Gen>::result_type continued_fraction_a(G
template <class Gen>
inline typename detail::fraction_traits<Gen>::result_type continued_fraction_a(Gen& g, int bits)
+ BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename detail::fraction_traits<Gen>::result_type) && noexcept(std::declval<Gen>()()))
{
BOOST_MATH_STD_USING // ADL of std names
@@ -234,6 +241,7 @@ inline typename detail::fraction_traits<Gen>::result_type continued_fraction_a(G
template <class Gen>
inline typename detail::fraction_traits<Gen>::result_type continued_fraction_a(Gen& g, int bits, boost::uintmax_t& max_terms)
+ BOOST_NOEXCEPT_IF(BOOST_MATH_IS_FLOAT(typename detail::fraction_traits<Gen>::result_type) && noexcept(std::declval<Gen>()()))
{
BOOST_MATH_STD_USING // ADL of std names