title: C++11 experiments, why can't I use some of the features?
body: <p>I'm currently overviewing the new features of C++11 and for currently ununderstood reasons, some of them does not compile. I use gcc version 4.6.0 20100703 (experimental) (GCC) so according to the GNU GCC FAQ, all features I tried are <a href="http://gcc.gnu.org/gcc-4.6/cxx0x_status.html" rel="nofollow noreferrer">supported</a> . I tried to compile with both of std=c++0x and std=gnu++0x flags.</p>
  <h2>Non member begin() &amp; end()</h2>
  <p>For instance, I wan't to use non member begin() and end(), in piece of code like :</p>
  <pre><code>#include &lt;iostream&gt;
  #include &lt;map&gt;
  #include &lt;utility&gt;
  #include &lt;iterator&gt;
  
  using namespace std;
  int main ( ) {
      map &lt; string, string &gt; alias;
      alias.insert ( pair &lt; string, string &gt; ( &quot;ll&quot;, &quot;ls -al&quot; ) );
      // ... Other inserts
  
      auto it = begin(alias);
      while ( it != end(alias) ) {
          //...
      }
  </code></pre>
  <p>And I get,</p>
  <pre class="lang-none prettyprint-override"><code>nonMemberBeginEnd//main.cc:15:24: error: ‘begin’ was not declared in this scope
  nonMemberBeginEnd//main.cc:15:24: error: unable to deduce ‘auto’ from ‘&lt;expression error&gt;’ // Ok, this one is normal.
  nonMemberBeginEnd//main.cc:16:26: error: ‘end’ was not declared in this scope
  </code></pre>
  <p>Do I need to include special headers ?</p>
  <h2>For range</h2>
  <p>My second (and last) question is weirder because It cannot depend on black magic hidden header that I might had not included.</p>
  <p>The following code :</p>
  <pre><code>for ( auto kv : alias )
      cout &lt;&lt; kv.first &lt;&lt; &quot; ~ &quot; &lt;&lt; kv.second &lt;&lt; endl;
  </code></pre>
  <p>Give me the following errors :</p>
  <pre><code>rangeFor/main.cc:15:17: error: expected initializer before ‘:’ token
  </code></pre>
  <p>I hope my questions are not off topic or too rookie for you guys and you'll help me find out what's wrong :D</p>