<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2013/12/13 Ville Voutilainen <span dir="ltr"><<a href="mailto:ville.voutilainen@gmail.com" target="_blank">ville.voutilainen@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="im"><br>
</div>Why don't you do<br>
std::function<void(T)>*fun = new std::function<void(T)>(Callback{});<br>
delete fun;<br>
instead? Apply auto* where necessary.<br></blockquote><div><br></div><div>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.<br>
<br></div><div>Well, having rules simpler has merit, but it also prevents certain styles of programming.<br><br></div><div>Regards,<br></div><div>&rzej<br></div></div></div></div>