Opened 9 years ago

Closed 9 years ago

#8702 closed Patches (fixed)

Error in size_type detection in has_size_type

Reported by: Antony Polukhin Owned by: Neil Groves
Milestone: Boost 1.54.0 Component: range
Version: Boost 1.52.0 Severity: Regression
Keywords: size_type trait no_type Cc:

Description

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.

Change History (1)

comment:1 by Neil Groves, 9 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.