Why does this code compile?
std::function<void(const int&)> f = [](int a)
{
};
Aren't int
and const int&
different types?
They are different, but it does not matter, because const int&
argument can be passed to int
parameter, and that is all that is required.
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