title: How can I use stl iterators with Eigen?
body: <p>I am trying to use the Library Eigen in a project and I have to sort a vector. I tried to follow the documentation and it says that the library should work in the predictable way with the STL iterators and algorithms <a href="https://eigen.tuxfamily.org/dox-devel/group__TutorialSTL.html" rel="nofollow noreferrer">https://eigen.tuxfamily.org/dox-devel/group__TutorialSTL.html</a>.
  However when I try to run the following test code</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;algorithm&gt;
  #include &lt;eigen3/Eigen/Dense&gt;
  #include &lt;eigen3/Eigen/Core&gt;
  int main()
  {
      Eigen::Array4i v = Eigen::Array4i::Random().abs();
      std::cout &lt;&lt; "Here is the initial vector v:\n" &lt;&lt; v.transpose() &lt;&lt; "\n";
      std::sort(v.begin(), v.end());
      std::cout &lt;&lt; "Here is the sorted vector v:\n" &lt;&lt; v.transpose() &lt;&lt; "\n";
      return 0;
   }
  </code></pre>
  
  <p>I get the two following errors:</p>
  
  <pre><code>error: ‘Eigen::Array4i’ {aka ‘class Eigen::Array&lt;int, 4, 1&gt;’} has no member named ‘begin’
  9 | std::sort(v.begin(), v.end());
    |             ^~~~~
  error: ‘Eigen::Array4i’ {aka ‘class Eigen::Array&lt;int, 4, 1&gt;’} has no member named ‘end’
  9 | std::sort(v.begin(), v.end());
  </code></pre>
  
  <p>I tested it with gcc 9.1.0 and 7.4.0 and my version of Eigen is 3.3.4. I am using Ubuntu 18.04 and the library is in the usual location /usr/include. All the other functionality I tried seem to work properly.
  Is it a well known bug, is it a compiler problem or is it a version problem?</p>