
6 May
2015
6 May
'15
11:43 a.m.
On 5/6/2015 2:24 PM, Alex Perry wrote:
On 05 May 2015 23:24 Boris Rasin [mailto:boris@pointx.org] wrote:
On 5/6/2015 1:08 AM, James Armstrong wrote:
Do you mean something that would work along the lines of...
Snip...
//iterate through doubles for (auto itr = itr_begin<double>(my_vec); itr != itr_end<double>(my_vec); ++itr) { // ... } Snip Yes. And this would work with std::vectorboost::any and std::listboost::variant alike. How would this differ from using boost.range filters?
eg #include
for (auto & val : boost::adaptors::filter(my_vec, []( boost::any & i) { return !i.empty() && i.type() == typeid(int); } ) ) { }
It wouldn't. Just a bit cleaner syntax, something like this: for (auto& val : type_filter<int>(my_vec)) { }