Re: [Boost-bugs] [Boost C++ Libraries] #11149: boost::multiprecision compilation fail with std::max

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #11149: boost::multiprecision compilation fail with std::max
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2016-02-16 22:53:32


#11149: boost::multiprecision compilation fail with std::max
-------------------------------+----------------------------
  Reporter: minorlogic@… | Owner: johnmaddock
      Type: Bugs | Status: closed
 Milestone: To Be Determined | Component: multiprecision
   Version: Boost 1.57.0 | Severity: Showstopper
Resolution: wontfix | Keywords:
-------------------------------+----------------------------

Comment (by dbrake@…):

 Replying to [comment:6 johnmaddock]:

 hi john, i replaced the number<Backend, et_on> with the deduced type
 similar to the return type from those two templates:


 {{{
 namespace boost { namespace multiprecision {

 template <class Backend, class tag, class A1, class A2, class A3, class
 A4>
         inline number<Backend, et_on> min(const number<Backend, et_on>&
 arg, const detail::expression<tag, A1, A2, A3, A4>& a)
         {
                 number<Backend, et_on> t(a);
                 return (std::min)(arg, t);
         }
 template <class tag, class A1, class A2, class A3, class A4, class
 Backend>
         inline number<Backend, et_on> min(const detail::expression<tag,
 A1, A2, A3, A4>& arg, const number<Backend, et_on>& a)
         {
                 number<Backend, et_on> t(arg);
                 return (std::min)(arg, a);
         }
 template <class tag, class A1, class A2, class A3, class A4, class tagb,
 class A1b, class A2b, class A3b, class A4b>
         inline typename detail::expression<tag, A1, A2, A3,
 A4>::result_type min(const detail::expression<tag, A1, A2, A3, A4>& arg,
 const detail::expression<tagb, A1b, A2b, A3b, A4b>& a)
         {
                 using N = typename detail::expression<tag, A1, A2, A3,
 A4>::result_type;
                 N t1(arg), t2(a);
                 return (std::min)(arg, a);
         }

 template <class Backend, class tag, class A1, class A2, class A3, class
 A4>
         inline number<Backend, et_on> max(const number<Backend, et_on>&
 arg, const detail::expression<tag, A1, A2, A3, A4>& a)
         {
                 number<Backend, et_on> t(a);
                 return (std::max)(arg, t);
         }
 template <class tag, class A1, class A2, class A3, class A4, class
 Backend>
         inline number<Backend, et_on> max(const detail::expression<tag,
 A1, A2, A3, A4>& arg, const number<Backend, et_on>& a)
         {
                 number<Backend, et_on> t(arg);
                 return (std::max)(arg, a);
         }
 template <class tag, class A1, class A2, class A3, class A4, class tagb,
 class A1b, class A2b, class A3b, class A4b>
         inline typename detail::expression<tag, A1, A2, A3,
 A4>::result_type max(const detail::expression<tag, A1, A2, A3, A4>& arg,
 const detail::expression<tagb, A1b, A2b, A3b, A4b>& a)
         {
                 using N = typename detail::expression<tag, A1, A2, A3,
 A4>::result_type;
                 N t1(arg), t2(a);
                 return (std::max)(arg, a);
         }

 } }
 }}}

 These type replacements for these two templates appear ok.

 My use of Eigen for JacobiSVD still fails, due to missing max. I am
 including the file with the above code before `#include <Eigen/Core>` or
 any other Eigen files, so I am still puzzled. I will get a minimal
 working example together to ensure that the rest of my project is not
 interfering with this solution. Thanks again for the help.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/11149#comment:10>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.

This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:19 UTC