C++ Macro definition including dot?
<p>I have some C++ code that I can't change, only by changing header files. I have the code and can compile it.</p>
<p>The issue is that I have a function pointer defined something like this (function pointer is kind of irrelevant to what I want to do):</p>
<pre><code>foo.bar();
</code></pre>
<p>I would like change that with a macro or something to:</p>
<pre><code>#define foo.bar() FunCall()
</code></pre>
<p>The issue as I understand is that it is not possible to use dots in a macro, is there any other way?</p>
<h1>Edit:</h1>
<p>A bit more info. The code I get is intended to run a single instance, however I'm wrapping the code to run multiple instances in a class. That gives some headaches I'm trying to over come.</p>
<p>What I'm trying is either to use a macro and some inline functions or a complete third way:</p>
<pre><code> void function()
{
    foo.bar();
}
</code></pre>
<p>I need some code that could make above equivalent to:</p>
<pre><code>void class::function()
{
    EventFuncTypedef f = foo.bar;
    (this-&gt;*f)();
}
</code></pre>
<p>Or</p>
<pre><code>void class::function()
{
    class::FunCall();
}
</code></pre>
<p>The code above all work the issue is to try get option 1 or 2 executed by the original code.</p>