ostringstream overloading const char * with the void *
<p>im having an issue with the ostream, I have written a very basic macro that should print out its parameters.</p>

<p>Please see example code below:</p>

<pre><code>#define LOG Message(__FILE__, __LINE__,__func__)

class Message : public std::ostringstream 
{
    public:
        Message(const char *param1, int param2, const char *param3)
        {
            *this&lt;&lt;param3&lt;&lt;"("&lt;&lt;param1&lt;&lt;":"&lt;&lt;param2&lt;&lt;")";
        }
        ~Message()
        {
            *this&lt;&lt;endl;
            cout&lt;&lt; rdbuf()-&gt;str();
        }
};


int main()
{
    int integer = 1;
    string str = "XYZ";

    LOG&lt;&lt;integer&lt;&lt;"DEBUGLOG1: "&lt;&lt;str&lt;&lt;" "&lt;&lt;integer;
    return 0;
}
</code></pre>

<p>The problem is if I use:</p>

<pre><code>LOG &lt;&lt; "LOG1: " &lt;&lt; str &lt;&lt; " " &lt;&lt; integer;
</code></pre>

<p>The output prints the Address* of the const char* "LOG1: " rather than the value.</p>

<p>But,
If I use:</p>

<pre><code>LOG &lt;&lt; integer &lt;&lt; "DEBUGLOG1: " &lt;&lt; str &lt;&lt; " " &lt;&lt; integer;
</code></pre>

<p>The output works perfect, printing the integer value and the char value.</p>

<p>it looks like instead of using <code>ostream&amp; operator&lt;&lt; (ostream&amp; out, const char* s );</code></p>

<p>it is using <code>ostream&amp; operator&lt;&lt; (const void* val);</code> ?</p>

<p>Can anyone shed any light on what can be done to overcome this overloading please?</p>

<p>Thanks in advance</p>
