Subject: [Boost-bugs] [Boost C++ Libraries] #8702: Error in size_type detection in has_size_type
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-06-17 07:05:32
#8702: Error in size_type detection in has_size_type
--------------------------------------+------------------------
Reporter: apolukhin | Owner: neilgroves
Type: Patches | Status: new
Milestone: Boost 1.54.0 | Component: range
Version: Boost 1.52.0 | Severity: Regression
Keywords: size_type trait no_type |
--------------------------------------+------------------------
File `boost/range/size_type.hpp` contains an error. `has_size_type` does
not work well, because `sizeof(test<T>(0))` requires implicit conversion
of `0` to `size_type`. In case when `size_type` is not an `int`, function
`no_type `has_size_type`::test(Arg x)` will be chosen.
To fix that issue replace
{{{
template<typename C, typename Arg>
static no_type test(Arg x);
}}}
with
{{{
template<typename C>
static no_type test(...);
}}}
In that case attempt to do implicit conversion will be done before
converting choosing `no_type test(...)` version.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8702> 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:13 UTC