Boost logo

Boost Users :

Subject: Re: [Boost-users] [Range] Extending the library for a base class and all its derived - enable_if
From: Avi Kivity (avi_at_[hidden])
Date: 2014-04-25 07:54:20

On 04/25/2014 04:19 AM, Albert Yiamakis wrote:
> On 24/04/14 15:00, Avi Kivity wrote:
>> Would something like
>> template <typename C>
>> struct range_iterator<typename enable_if<is_base_of<Base, C>,
>> C>::type> { ... };
>> work?
> This does not compile.

Well, it should be

   template <typename C>
   struct range_iterator<typename enable_if<is_base_of<Base, C>::value, C>::type> { ... };

but an simpler example I tried also does not compile, complaining that
template parameter C is not used (though it clearly is). I wonder if
it's a bug in the error message (and the code is disallowed) or a real
compiler bug.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at