I'd like to construct a vector from data provided by a 3rd party lib.
The lib holds the data and provides access to it like this:
const uint8_t* data;
std::pair<const uint8_t*, const uint8_t*> getvalue() const {
return std::make_pair(data + offset, data + length);
}
For further processing this data I'd put it into a vector, but I'd like to avoid multiple calling of getvalue and if possible I'd also avoid creating a variable.
This is how I'm doing it now:
std::pair<const uint8_t*, const uint8_t*> dataPtrs = 3rdpartydata.getvalue();
vector<uint8_t> data(dataPtrs.first, dataPtrs.second);
It is working, but is there any way to make it better/simpler?