title: Making operator<< virtual?
body: <p>I need to use a virtual &lt;&lt; operator. However, when I try to write:</p>
  
  <pre><code>virtual friend ostream &amp; operator&lt;&lt;(ostream&amp; os,const Advertising&amp; add);
  </code></pre>
  
  <p>I get the compiler error</p>
  
  <blockquote>
    <p>Error 1 error C2575: 'operator &lt;&lt;' :
    only member functions and bases can be
    virtual</p>
  </blockquote>
  
  <p>How can I turn this operator virtual?</p>