<div dir="ltr">I'd start with the failure (diagnostic) when you try to do this right now. My guess is that name lookup will fail during CXXMemberCallExpr construction. You'd have to perform the lookup in some other context (global or some of the parent contexts) or implement new lookup type. I think you'll also have to modify overload resolution to "inject" the first argument into the method/function call.<div><br></div><div>This is just of the top of my head, I'm sure you'll get better answers from more experienced people.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Nov 1, 2014 at 7:08 AM, clang c <span dir="ltr"><<a href="mailto:walterh95@yahoo.co.uk" target="_blank">walterh95@yahoo.co.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="color:#000;background-color:#fff;font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,Sans-Serif;font-size:16px"><div>Could anyone who knows Clang comment how hard it would be to implement this (where would one start..) the desired feature is the ability for a method call a.f(b) to fall back to any suitable free-function f(a,b), for reasons explained in the first paper.</div><div>Has anyone tried to implement this already?</div><div><br></div><div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;background-color:transparent;font-style:normal">With this you don't have to choose between the superior decoupling of free functions & the superior autocomplete/function chaining of methods. Having to make this arbitrary choice is C++'s biggest frustration
 for me</div><div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;background-color:transparent;font-style:normal"><br></div><div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;background-color:transparent;font-style:normal"><a href="http://isocpp.org/files/papers/N4165.pdf" target="_blank">http://isocpp.org/files/papers/N4165.pdf</a><br></div><div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;background-color:transparent;font-style:normal"><br></div><div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;background-color:transparent;font-style:normal"><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4174.pdf" target="_blank">http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n4174.pdf</a><br></div><div><br></div></div></div><br>_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br></blockquote></div><br></div>