<div dir="ltr">When would this be useful, and the problem at hand couldn&#39;t be solved with:<br><a href="https://godbolt.org/z/65s7PePaW">https://godbolt.org/z/65s7PePaW</a><br>I think the implementation at ^ should match behaviour described in Jarrads paper, not sure.<br><div>Is there any observable difference between a free function version of a member function, and</div><div>a free function that behaves identically as the aforementioned free function?</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Jan 6, 2024 at 1:14 PM Frederick Virchanza Gotham via Std-Proposals &lt;<a href="mailto:std-proposals@lists.isocpp.org">std-proposals@lists.isocpp.org</a>&gt; wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sat, Jan 6, 2024 at 12:05 PM Frederick Virchanza Gotham wrote;<br>
&gt;<br>
&gt; Even though the &quot;offset<br>
&gt; for this&quot; is lost when &quot;std::memfunc_to_func&quot; is invoked, it could be<br>
&gt; regained when &quot;std::invoked_func_as_memfunc&quot; is invoked (as it can be<br>
&gt; determined from the type of the 2nd parameter -- i.e. the pointer to<br>
&gt; the object). This might even be an enhancement as it means the &#39;this&#39;<br>
&gt; pointer will be correctly adjusted no matter what object you give it<br>
&gt; (i.e. you&#39;re not limited to the type that was passed to<br>
&gt; &#39;std::memfunc_to_func&#39;).<br>
<br>
<br>
And therefore, even on implementations that use thunks,<br>
&quot;std::memfunc_to_func&quot; should not return the address of the thunk, but<br>
rather it should return the address of the bonafide function. Then<br>
it&#39;s the job of &quot;std::invoke_func_as_memfunc&quot; to adjust the &#39;this&#39;<br>
pointer where necessary.<br>
-- <br>
Std-Proposals mailing list<br>
<a href="mailto:Std-Proposals@lists.isocpp.org" target="_blank">Std-Proposals@lists.isocpp.org</a><br>
<a href="https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals" rel="noreferrer" target="_blank">https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals</a><br>
</blockquote></div>

