2013/12/13 Ville Voutilainen <ville.voutilainen@gmail.com>

Why don't you do
std::function<void(T)>*fun = new std::function<void(T)>(Callback{});
delete fun;
instead? Apply auto* where necessary.

Well, it is not a real-life use. I do not have to solve this problem in any of my projects. I had a hypothesis that "using veneers is safe", i.e. If I derive from a type that does not have virtual functions but I do not add any changes to the layout, it is a safe thing to do. It turns out that 5.3.5/3 makes it unsafe, but for no good reason.

Well, having rules simpler has merit, but it also prevents certain styles of programming.

Regards,
&rzej