Boost logo

Boost :

Subject: Re: [boost] [type_traits] Request: is_iterable
From: Nathan Crookston (nathan.crookston_at_[hidden])
Date: 2013-02-02 11:27:24


Hi Nevin,

Krzysztof Czainski wrote:

> Nathan Ridge:
> >
> > Nevin Liber:
> > > I'd like to make a request for an is_iterable<T> type trait, which
> detects
> > > if a type can be used in C++11 range-based for. I have a prototype
> which
> > > currently meets my needs (I can make it available; it detects if both
> > > std::begin(c) and std::end(c) can be called), but I'm wondering:
> > >
> > > a) What should the name be? (I'm not married to is_iterable)
> >
> > is_range ?
>
> +1

+1

> > > Does this sound like a good idea?
>
> +1
>
> There have been a few attempts in the past:

http://boost.2283326.n4.nabble.com/is-range-metafunction-td2650470.html
http://boost.2283326.n4.nabble.com/range-Trying-to-make-an-quot-is-range-quot-metafunction-td2580209.html

It seems most have concluded it's not possible in the general case. I
think you could get close enough to count, however. I'd be interested to
see the code, myself.

Thanks,
Nate


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