Note that there are some explanatory texts on larger screens.

plurals
  1. POgetting the name of the invoked function
    text
    copied!<p>when using either the '.', '->' or '->*' operators is there any way of getting the name of the function invoked (or the name of the variable in the case of '->*' and everything goes.</p> <p><strong>EDIT:</strong> Just to clarify I'm not talking about reflection but more something in the line of '<strong>function</strong>' basically I want to create an overload of an operator (preferrably one of the three mentioned) which is aware of the right side of the operator</p> <p>What I'm trying to accomplish is basically a compile time transformation of</p> <pre><code>obj-&gt;Function(a,b); </code></pre> <p>to</p> <pre><code>obj-&gt;Map("Function")(a,b); //Where Map(string) returns a function pointer </code></pre> <p><strong>EDIT:</strong> Just to further clarify, The requirement is that the code will have to <em>look</em> like one of these three</p> <pre><code>obj.SomeMethod(args); obj-&gt;SomeMethod(args); obj-&gt;*SomeMethod(args); </code></pre> <p>any solution that fits that is acceptable as long as SomeMethod can be any valid identifier (I.e. any thing that can be used as a function name) and the solution will have to use SomeMethod as a lookup in a Map. The Map part is already implemented it's only the reinterpretation of what looks like a method call I seeking a solution to.</p> <p>if that (as I'm affraid) can't be done then any solution with a new "operator" syntax will be accepted. Such as obj __ SomeMethod(args); as long as the lookup is based on the RHS of the "operator"</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload