I have written a custom container class which contains a std::vector<double>
instance - works nicely. For compatibility with other API's I would like to export the content of the container as a std::vector<double>
copy . Currently this works:
MyContainer container;
....
std::vector<double> vc(container.begin(), container.end());
But if possible would like to be able to write:
MyContainer container;
....
std::vector<double> vc(container);
Can I (easily) create such a std::vector<double>
constructor?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With