@BjörnPollex Yes! I forgot to mention that.
I am learning STL these days and I was wondering if STL containers return by reference?
e.g:
vector.first();
map[key];
*vector.begin();
Or any possible return that ends with element (or value type) of container
e.g:
std::vector<int> elements;
elements.push_back(20);
elements[0]=60; // this will also change the value
elements.front() = 23; // even the functions also behave same way like subscript operator
is this the case with all containers? or there are some points to consider which I didn't show?
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