title: new c++11 for loop causes: "error: ‘begin’ was not declared in this scope"
body: <p>I'm trying to learn c++, so I wrote a short program that uses the new c++11 for loop, which makes the compiler give me an error I don't understand. 
  this is my c++ code:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cmath&gt;
  using namespace std;
  
  float legge_oraria_moto_accelerato(float a[3]){
      return a[2]*a[0] + 0.5*a[1]*a[0]*a[0];
  }
  int corri(float (f)(float array[3]), float arrays[3][3])
      { for(auto i:arrays) cout &lt;&lt; f(i) &lt;&lt; '\n';
      return 0;
  } 
  
  int main()
  { 
  return 0;
  }
  </code></pre>
  
  <p>and this is the compiler's (g++ -std=gnu++11) error:</p>
  
  <pre><code>mezzo.cpp: In function ‘int corri(float (*)(float*), float (*)[3])’:
  mezzo.cpp:9:18: error: ‘begin’ was not declared in this scope
       { for(auto i:arrays) cout &lt;&lt; f(i) &lt;&lt; '\n';
                    ^
  mezzo.cpp:9:18: note: suggested alternatives:
  In file included from /usr/include/c++/4.9/bits/basic_string.h:42:0,
                   from /usr/include/c++/4.9/string:52,
                   from /usr/include/c++/4.9/bits/locale_classes.h:40,
                   from /usr/include/c++/4.9/bits/ios_base.h:41,
                   from /usr/include/c++/4.9/ios:42,
                   from /usr/include/c++/4.9/ostream:38,
                   from /usr/include/c++/4.9/iostream:39,
                   from mezzo.cpp:1:
  /usr/include/c++/4.9/initializer_list:89:5: note:   ‘std::begin’
       begin(initializer_list&lt;_Tp&gt; __ils) noexcept
       ^
  /usr/include/c++/4.9/initializer_list:89:5: note:   ‘std::begin’
  mezzo.cpp:9:18: error: ‘end’ was not declared in this scope
       { for(auto i:arrays) cout &lt;&lt; f(i) &lt;&lt; '\n';
                    ^
  mezzo.cpp:9:18: note: suggested alternatives:
  In file included from /usr/include/c++/4.9/bits/basic_string.h:42:0,
                   from /usr/include/c++/4.9/string:52,
                   from /usr/include/c++/4.9/bits/locale_classes.h:40,
                   from /usr/include/c++/4.9/bits/ios_base.h:41,
                   from /usr/include/c++/4.9/ios:42,
                   from /usr/include/c++/4.9/ostream:38,
                   from /usr/include/c++/4.9/iostream:39,
                   from mezzo.cpp:1:
  /usr/include/c++/4.9/initializer_list:99:5: note:   ‘std::end’
       end(initializer_list&lt;_Tp&gt; __ils) noexcept
       ^
  /usr/include/c++/4.9/initializer_list:99:5: note:   ‘std::end’
  </code></pre>