I found this in std::vector::push_back() implementation:
void push_back(_Ty&& _Val)
{
// some code here
}
and this in std::map operator[] implementation:
mapped_type& operator[](key_type&& _Keyval)
{
// some code here
}
Why _Val and _Keyval is taking by the reference-by-reference? How does the taking of the argument by reference-by-reference working? What are the benefits of this approach in comparison with the taking by reference?
P.S. This is NOT the logical "AND", I understand this clearly.
This is a C++11 feature - rvalue references... Here's some more info
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