Boost Circular Buffer Question
Hi! I have a vector of strings called citiesvector. For each string, I want to create a boost circular buffer named for that string. I tried the following code, but it isn't working:
for(unsigned int i = 0; i < citiesvector.size(); i++)
new boost::circular_buffer<double> citiesvector.at(i) (32);
Is there any way to do this correctly? Thanks!
No, you can't directly create variable names at runtime.
You can make a std::map< std::string, boost::circular_buffer<double> > though.
Topic archived. No new replies allowed.