Consider
#include <iostream>
struct Foo{};
int main(){
try {
throw Foo();
} catch (Foo& e){
std::cout << "Caught";
}
}
The output is Caught, but why? I would have thought that the catch should have been const Foo&. What am I forgetting?