I have this class definition:
class FlashStream
{
public:
explicit FlashStream(const char * url, vector * headers, vector * dat
This statement:
_streams.push_back(FlashStream(url, headers, data, _npp.ndata, notifyData, lastModified));
is equivalent to:
{
FlashStream temp(url, headers, data, _npp.ndata, notifyData, lastModified);
_streams.push_back(temp);
// temp gets destroyed here
}
so, you create a temporary FlashStream object that is copied into the vector, then destructed afterwards. You can avoid this by using emplace_back() in C++11:
_streams.emplace_back(url, headers, data, _npp.ndata, notifyData, lastModified);