I can use a loop to copy elements from boost::any vector to std::vector of floats.
It is inefficient in the sense that there are 50000 values to copy, vector can grow beyond 50K and I have to save the to the disk in different folders. So it is a bottleneck.
So far the following wont work
vector<boost::any> v1
vector<float> v2
std::fill(v1.begin().v1.end(),v2) // This will not copy anything.
According to this,
will work.
... reserve(...) is the most important line here [ so that you don't reallocate memory when you add more and more items to the vector ].
To be honest, I don't really understand how to do it efficiently (memcpy-like), because you have a number of objects of different type, and to add it to another container, you have to cast EACH one to that type. You can't possibly do it more efficient than with a simple cycle or what other STL stuff provides (which is also a simple cycle anyway).