c++ passing string to varargs
<pre><code>#define LOG(format,...) Logger::Log(format,__VA_ARGS__)
#define STRIP(netIp) GeneralUtils::inet_ntop_(netIp)
string GeneralUtils::inet_ntop_(unsigned int netIp){
    char strIP[INET_ADDRSTRLEN];
    in_addr sin_addr;
    sin_addr.s_addr = netIp;
    inet_ntop(AF_INET, &amp;sin_addr.s_addr, strIP, sizeof strIP);
    return string(strIP);
}
</code></pre>

<p>when calling to :</p>

<pre><code>LOG("src %s dst %s" ,STRIP(src_ip_));
</code></pre>

<p>i get compilation error:</p>

<pre><code>cannot pass objects of non-trivially-copyable type ‘std::string {aka struct std::basic_string&lt;char&gt;}’ through ‘...’
</code></pre>

<p>I understand that varargs is c compatible , so i cannot send string to it.
Is there a simple way to bypass it?
Will it be correct to fix it like this:</p>

<pre><code>#define STRIP(netIp) GeneralUtils::inet_ntop_(netIp).data()
</code></pre>
