Re: [Boost-bugs] [Boost C++ Libraries] #9944: Regression test relies on undefined compiler behavior

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9944: Regression test relies on undefined compiler behavior
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2014-04-23 21:02:30


#9944: Regression test relies on undefined compiler behavior
-------------------------------+--------------------------------
  Reporter: chris.cooper@… | Owner: grafik
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: Regression Testing
   Version: Boost 1.54.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+--------------------------------

Comment (by chris.cooper@…):

 std::numeric_limits<Number>::min() and std::numeric_limits<Number>::max()
 are not constant expressions unless c++11 is specified, so a better fix is

 {{{
 #if !defined(BOOST_NO_LIMITS) && !defined(BOOST_NO_CXX11_CONSTEXPR)
 template <class Number> struct complement_traits {
    BOOST_STATIC_CONSTANT(Number, min =
 std::numeric_limits<Number>::min());
    BOOST_STATIC_CONSTANT(Number, max =
 std::numeric_limits<Number>::max());
 };
 #else
 [SNIP] All of the other template definitions for complement_traits,
 complement_traits_aux, etc.
 #endif
 }}}

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9944#comment:1>
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:16 UTC