[Boost-bugs] [Boost C++ Libraries] #1477: boost::sizer declaration ill-formed

Subject: [Boost-bugs] [Boost C++ Libraries] #1477: boost::sizer declaration ill-formed
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2007-11-25 14:03:39


#1477: boost::sizer declaration ill-formed
------------------------------+---------------------------------------------
 Reporter: anonymous | Owner: nesotto
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: range
  Version: Boost 1.34.1 | Severity: Problem
 Keywords: |
------------------------------+---------------------------------------------
 Since the acception of boost::range there exists the file
 /range/detail/sizer.hpp
 (I think it was taken from still older history) which contains two
 overloads of sizer,
 which are written as (I provide only the first overload):

 template< typename T, std::size_t sz >
     char&
     sizer( const T BOOST_RANGE_ARRAY_REF()[sz] )[sz];

 This declaration is ill-formed, because it corresponds to a function that
 returns an
 array. The declaration should be fixed to say

 template< typename T, std::size_t sz >
     char
     (& sizer( const T BOOST_RANGE_ARRAY_REF()[sz] ) )[sz];

 (similarily for the other overload). Interestingly, the declaration is
 *not* contained in some detail(s) namespace, but you might consider this
 file to be part of the implementation. In this case another option could
 be to remove this file, although I would regret this choice. Note that
 boost is often quoted in the internet (including this sizer facility!) so
 it seems better to fix the declaration.

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1477>
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:49:57 UTC