<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">2013/12/13 Ville Voutilainen <span dir="ltr">&lt;<a href="mailto:ville.voutilainen@gmail.com" target="_blank">ville.voutilainen@gmail.com</a>&gt;</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&#39;t you do<br>
std::function&lt;void(T)&gt;*fun = new std::function&lt;void(T)&gt;(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 &quot;using veneers is safe&quot;, 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>&amp;rzej<br></div></div></div></div>