Re: [Boost-bugs] [Boost C++ Libraries] #4462: make_signed is not SFINAE friendly

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #4462: make_signed is not SFINAE friendly
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2010-07-22 17:46:52


#4462: make_signed is not SFINAE friendly
---------------------------------+------------------------------------------
  Reporter: 1czajnik@… | Owner: johnmaddock
      Type: Bugs | Status: closed
 Milestone: Boost 1.44.0 | Component: type_traits
   Version: Boost 1.44.0 | Severity: Problem
Resolution: invalid | Keywords: sfinae
---------------------------------+------------------------------------------

Comment (by anonymous):

 I see. Thank You for the quick reply. I have tried the enable_if sollution
 before, like so:

 template < class T >
 inline
 typename boost::enable_if< boost::is_integral<T>, typename
 boost::make_signed<T>::type >::type
 signed_value( T a )
 {
         return a;
 }

 It didn't work. But now I came up with a working version - obviously lazy
 evaluation is needed:

 template < class T >
 inline
 typename boost::lazy_enable_if< boost::is_integral<T>,
 boost::make_signed<T> >::type
 signed_value( T a )
 {
         return a;
 }

 Cheers.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/4462#comment:2>
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:03 UTC