05.06.2015 15:28, Andrzej Krzemienski:
Same applies to boost::variant, and even to "classic OO" - it's just general polymorphism considerations.
For example: hcl::vector<Types> v, z; // ... for_each(v, [&](auto &x) { draw(x); // ... if(something(x)) push_back(z, x); }); // ... for_each(z, [](auto &x)) { serialize(x); });
Ok, I understand. I wish what I was told in this thread was synthesized and displayed in the introduction page or in documentation. Also, the for_each you presented, perhaps it should be part of this library's interface?
Yes, of course it should be in library. I presumed that it was already there, but I didn't checked. And I think not just for_each - such kind of library should contain (several/many) algorithms + containers, not just containers. Best Regards, Evgeny Panasyuk