Boost logo

Boost :

Subject: Re: [boost] is_range metafunction
From: David Abrahams (dave_at_[hidden])
Date: 2008-10-03 16:03:34


on Fri Oct 03 2008, Neal Becker <ndbecker2-AT-gmail.com> wrote:

> I could use one to enable a range constructor only where appropriate:
>
> class X {
> template<typename range_t>
> X (range_t const&, enable_if<is_range<range_t> >::type *dummy=0)
>
> Question is, what might 'is_range' look like?

I don't think it's really possible to detect it accurately. You can
find out if range_begin() is overloaded in range_t's namespace, but when
that is namespace boost it's not very useful information because of the
default implementations. Maybe we should sink those into a
subnamespace and then pull them out with a using declaration.

-- 
Dave Abrahams
BoostPro Computing
http://www.boostpro.com

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk