<div dir="ltr">On 8 June 2013 12:29, Michel Fortin <span dir="ltr"><<a href="mailto:michel.fortin@michelf.ca" target="_blank">michel.fortin@michelf.ca</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 2013-06-07 23:57:40 +0000, Manu <<a href="mailto:turkeyman@gmail.com" target="_blank">turkeyman@gmail.com</a>> said:<br>

<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Precisely. The concept is already embedded inside of delegate, but delegate<br>
is framed like a piece of magic, rather than a well defined compound of<br>
more primitive pieces.<br>
</blockquote>
<br></div>
Delegates are not parametrized on the type of "this", which makes them easier to move around. I would not change delegates.<br></blockquote><div><br></div><div style>Actually, that's very true. Good point, and I think this is almost the key distinction.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
But function pointers with a "this" parameter would be useful. You can achieve this using a template struct containing a pointer and a call method: the call method would generate a local delegate variable from the pointer and and call it. What you can't do without compiler support is get such a pointer in a type-safe manner.</blockquote>
<div><br></div><div style>Yup, this is what I originally did. It's big and ugly, I didn't like it, and deleted it. I think the syntax I suggest is simple and obvious, and naturally, typesafe.</div></div></div></div>