Note that there are some explanatory texts on larger screens.

plurals
  1. POTwo Phase Lookup operator << issue?
    primarykey
    data
    text
    <p>I'm trying to port my own code from VS2012 to g++4.8. </p> <p>I'm getting this compliation error:</p> <pre><code>AllocationManager.cpp: In member function ‘void AllocationManager::printMemoryLeaks()’: TRLogger.h:247:42: error: ‘streamAggrator’ was not declared in this scope #define TRLOG_INFO streamAggrator(logINFO) &lt;&lt; PACKET_DESCRIPTION &lt;&lt; __FUNCTION__ &lt;&lt; ":" &lt;&lt; __LINE__ &lt;&lt; ": " ^ AllocationManager.cpp:39:2: note: in expansion of macro ‘TRLOG_INFO’ TRLOG_INFO &lt;&lt; "sdfs\n"; </code></pre> <p>Where <code>printMemoryLeaks</code> is a dummy function (<code>AllocationManager</code> is not templated):</p> <pre><code>void AllocationManager::printMemoryLeaks(void) { TRLOG_INFO &lt;&lt; "sdfs\n"; } </code></pre> <p>In the file <code>TRLogger.h</code>:</p> <pre><code>enum TLogLevel {logERROR, logWARNING, logINFO, logDEBUG, logDEBUG1, logDEBUG2, logDEBUG3, logDEBUG4}; class streamAggrator { public: streamAggrator(TLogLevel logLevel); /* private: */ FILELog fLog; WarnLog wlog; std::ostringstream&amp; s1; std::ostringstream&amp; s2; }; template&lt;typename T&gt; streamAggrator&amp; operator&lt;&lt;(streamAggrator&amp; agg, const T&amp; obj) { agg.s1 &lt;&lt; obj; agg.s2 &lt;&lt; obj; agg.s2.flush(); return agg; } </code></pre> <p>....</p> <pre><code>#define TRLOG_INFO streamAggrator(logINFO) &lt;&lt; PACKET_DESCRIPTION &lt;&lt; __FUNCTION__ &lt;&lt; ":" &lt;&lt; __LINE__ &lt;&lt; ": " </code></pre> <p>How can I solve this function - I didn't find any place that I can use <code>this</code> or <code>using</code> to help the compiler.</p> <p>Thanks, Guy</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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