Re: [Boost-bugs] [Boost C++ Libraries] #9517: boost gil compile error because of type narrowing

Subject: Re: [Boost-bugs] [Boost C++ Libraries] #9517: boost gil compile error because of type narrowing
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2017-05-10 07:21:38


#9517: boost gil compile error because of type narrowing
-------------------------------+---------------------
  Reporter: ryan.burn@… | Owner: hljin
      Type: Bugs | Status: new
 Milestone: To Be Determined | Component: GIL
   Version: Boost 1.54.0 | Severity: Problem
Resolution: | Keywords:
-------------------------------+---------------------

Comment (by frederic.bron@…):

 This is easy to to fix. integral_c is defined by:
 template< typename T, T N > struct integral_c;

 So the 2nd template parameter is of type T=UnsignedIntegralChannel.

 Therefore, -1 can easily be replaced by either
 std::numeric_limits<UnsignedIntegralChannel>::max() or
 static_cast<UnsignedIntegralChannel>(-1)

 See patch attached.

-- 
Ticket URL: <https://svn.boost.org/trac/boost/ticket/9517#comment:5>
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-05-10 07:25:06 UTC