title: g++ "declaration of "operator<<" as non-function"
body: <p>We have a custom Logging class which compiles fine in VisualStudio 2010, but throws errors when being compiled with g++ on Linux. The error message we receive are the following:</p>
  
  <pre><code>Logger.hpp:84: error: declaration of "operator&lt;&lt;" as non-function
  Logger.hpp:84: error: expected ";" before "(" token
  Logger.hpp:91: error: expected ";" before "inline"
  Logger.hpp:91: error: declaration of "operator&lt;&lt;" as non-function
  Logger.hpp:91: error: expected ";" before "(" token
  Logger.hpp:98: error: expected ";" before "typedef"
  </code></pre>
  
  <p>The respective lines of code are the following:</p>
  
  <pre><code>/*:84*/inline Logger&amp; operator&lt;&lt;(std::_Smanip&lt;std::ios_base::fmtflags&gt; output)
  {
          if (this-&gt;loggingEnabled())
                  std::cout &lt;&lt; output;
          return *this;
  }
  
  inline Logger&amp; operator&lt;&lt;(std::_Smanip&lt;std::streamsize&gt; output)
  {
          if (this-&gt;loggingEnabled())
                  std::cout &lt;&lt; output;
          return *this;
  }
  
  typedef std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp; (*StdEndl)(std::basic_ostream&lt;char, std::char_traits&lt;char&gt; &gt;&amp;);
  inline Logger&amp; operator&lt;&lt;(StdEndl output)
  {
          if (this-&gt;loggingEnabled())
                  std::cout &lt;&lt; output;
          return *this;
  }
  </code></pre>
  
  <p>Other methods overloading the <code>&lt;&lt;</code> operator work fine, therefore my guess is that the errors have something to with the argument type (<code>std::_Smanip</code>); any clues as to why?</p>
  
  <p>Thanks,
  Ben</p>