
5 May
2015
5 May
'15
10:23 p.m.
On 5/6/2015 1:08 AM, James Armstrong wrote:
Do you mean something that would work along the lines of...
std::vectorboost::any my_vec; // fill my_vec with various data types
//iterate through doubles for (auto itr = itr_begin<double>(my_vec); itr != itr_end<double>(my_vec); ++itr) { // ... }
//iterate through strings for (auto itr = itr_beginstd::string(my_vec); itr != itr_endstd::string(my_vec); ++itr) { // ... }
where itr_begin and itr_end generate iterators for the templated type over any container of type erased objects. I didn't quite get what you were suggesting at first, but yeah I think I agree that would be more useful.
Yes. And this would work with std::vectorboost::any and std::listboost::variant alike.