I have a class with a non trivial constructor:
class mystream
{
public:
mystream(size_t buffersize,size_t index) : buffersize(buffersize),index(index){}
size_t buffersize;
size_t index;
};
The mystream
instance has an unique id which corresponds with its position in a vector of the managing class:
class mystreammanager
{
public:
mystreammanager() : streams(8,1024, /* WHAT TO DO HERE ??? */ )
{
}
std::vector<mystream> streams;
};
How can I construct the vector and initialize its elements with an ascending value for the index?