<div dir="ltr">On 11 June 2013 02:28, Jacob Carlborg <span dir="ltr"><<a href="mailto:doob@me.com" target="_blank">doob@me.com</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-10 17:36, Manu wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
My suggestion is: void function(T this) funcptr;<br>
This is a function pointer (not a delegate), but using keyword 'this'<br>
gives the critical detail to the compiler that it's a member function<br>
pointer, and to use the appropriate calling convention when making calls<br>
through this pointer.<br>
UFCS makes it awesome.<br>
</blockquote>
<br></div>
What I don't understand is what this give you that a delegate doesn't. You need the "this" pointer to call the function pointer anyway. With a delegate it's bundled.</blockquote><div><br></div><div style>
It's just a pointer, 'this' is associated at the call site. And it's strongly typed.</div><div style>If you don't want a bundle, why be forced to use a bundled type?</div><div style><br></div><div style>
Consider this, why would you ever want an int* when you can have an int[]?</div><div style>We could remove the syntax for int*, and make it only accessible via int[].ptr... and make: is(typeof(int[].ptr) == size_t)? :)</div>
</div></div></div>