Verified Commit 58d2ca07 authored by Justin Carpentier's avatar Justin Carpentier
Browse files

math/multiprecision: fix boost issue for old versions

parent 1ca196ec
......@@ -30,6 +30,21 @@ namespace Eigen
#ifndef BOOST_MP_EIGEN_HPP
namespace boost {
namespace multiprecision {
namespace fix {
template <class T>
struct scalar_result_from_possible_complex
{
typedef typename mpl::if_c<number_category<T>::value == number_kind_complex,
typename component_type<T>::type, T>::type type;
};
} // namespace fix
} // namespace multiprecision
} // namespace boost
// Code adapted from <boost/multiprecision/eigen.hpp>
// Copyright 2018 John Maddock. Distributed under the Boost
// Software License, Version 1.0. (See accompanying file
......@@ -40,7 +55,7 @@ namespace Eigen
struct NumTraits<boost::multiprecision::number<Backend, ExpressionTemplates> >
{
typedef boost::multiprecision::number<Backend, ExpressionTemplates> self_type;
typedef typename boost::multiprecision::scalar_result_from_possible_complex<self_type>::type Real;
typedef typename boost::multiprecision::fix::scalar_result_from_possible_complex<self_type>::type Real;
typedef self_type NonInteger; // Not correct but we can't do much better??
typedef double Literal;
typedef self_type Nested;
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment