Boost logo

Boost :

Subject: [boost] [type_traits] Request: is_iterable
From: Nevin Liber (nevin_at_[hidden])
Date: 2013-02-01 16:48:26


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)
b) Should there be a second template parameter indicating the type
returned by derefencing the iterator, defaulting to don't care.
c) What should the C++03 behavior be?
d) Is there someone with more expertise than I willing to implement a
robust version of it?

Does this sound like a good idea?

-- 
 Nevin ":-)" Liber  <mailto:nevin_at_[hidden]>  (847) 691-1404

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