Why does scope of using directive make a difference?
<p>Below are two simplified code examples: the first one compiles just fine, the second one emits a compile error (no operator &lt;&lt; found which takes a left hand operator ByteVector...). </p>

<p>The only difference in between the two examples is the <strong>placement of the using directive</strong>.</p>

<p>I don't want to know why it fails (you got not enough information to answer this), I am only interested in why it does make <em>any</em> difference where I place the <code>using</code>.  </p>

<p>I would have expected the exact same behaviour in both examples.</p>

<p><strong>Compiles without error</strong></p>

<pre><code>ByteVector Test()
{
   using Base::operator &lt;&lt;;

   ByteVector foo;
   int bar = 1;
   foo &lt;&lt; bar;
   return foo;
}
</code></pre>

<p><strong>Compiles with error</strong></p>

<pre><code>using Base::operator &lt;&lt;;

ByteVector Test()
{
   ...same as above, without using
}
</code></pre>

<p>Extra information:</p>

<p>The operator&lt;&lt; used is defined as follows</p>

<pre><code>template&lt;typename T&gt;
ByteVector&amp; operator&lt;&lt;(ByteVector &amp;, const T&amp;){...};
</code></pre>
