title: Why does std::less<Eigen::VectorXd> fail to compile?
body: <p>I implemented a comparison operator <code>operator&lt;</code> for <code>Eigen::VectorXd</code>, and sometimes, I need to pass a compare function to another of my function, I am tired of wrapping the <code>operator&lt;</code> into <code>[](const VectorXd&amp; v1, const VectorXd&amp; v2)-&gt;bool{return v1 &lt; v2}</code>, so I think the <code>std::less</code> class would be useful, as, to my understanding, it can generate the lambda function as long as <code>operator&lt;</code> is defined.</p>
  
  <p>However, I found that <code>std::less&lt;VectorXd&gt;</code> didn't work for me, for example, the below code works fine:</p>
  
  <pre><code>#include "Eigen/Dense"
  #include &lt;iostream&gt;
  #include &lt;functional&gt;
  
  using namespace std;
  using namespace Eigen;
  
  struct T
  {
      int x;
  };
  
  bool operator&lt;(const T&amp; t1, const T&amp; t2)
  {
      return t1.x &lt; t2.x;
  }
  
  bool operator&lt;(const VectorXd&amp; v1, const VectorXd&amp; v2)
  {
      return (v1.array() &lt;= v2.array()).all() and (v1 != v2);
  }
  int main()
  {
      T t1, t2;
      t1.x = 3;
      t2.x = 2;
  
      auto ft = std::less&lt;T&gt;();
      cout &lt;&lt; ft(t1, t2) &lt;&lt; endl;
  
      return EXIT_SUCCESS;
  }
  </code></pre>
  
  <p>However, if I use <code>std::less&lt;VectorXd&gt;</code> like this:</p>
  
  <pre><code>#include "Eigen/Dense"
  #include &lt;iostream&gt;
  #include &lt;functional&gt;
  
  using namespace std;
  using namespace Eigen;
  
  struct T
  {
      int x;
  };
  
  bool operator&lt;(const T&amp; t1, const T&amp; t2)
  {
      return t1.x &lt; t2.x;
  }
  
  bool operator&lt;(const VectorXd&amp; v1, const VectorXd&amp; v2)
  {
      return (v1.array() &lt;= v2.array()).all() and (v1 != v2);
  }
  int main()
  {
      T t1, t2;
      t1.x = 3;
      t2.x = 2;
  
      auto ft = std::less&lt;T&gt;();
      cout &lt;&lt; ft(t1, t2) &lt;&lt; endl;
  
      VectorXd v1(3);
      VectorXd v2(3);
      v1 &lt;&lt; 1, 2, 3;
      v2 &lt;&lt; 2, 3, 4;
      auto fv = std::less&lt;VectorXd&gt;();
      cout &lt;&lt; fv(v1, v2) &lt;&lt; endl;
  
      return EXIT_SUCCESS;
  }
  </code></pre>
  
  <p>The code fails to compile, and I get error messages like below:</p>
  
  <pre><code>In file included from /usr/include/c++/5/string:48:0,
                   from /usr/include/c++/5/bits/locale_classes.h:40,
                   from /usr/include/c++/5/bits/ios_base.h:41,
                   from /usr/include/c++/5/ios:42,
                   from /usr/include/c++/5/istream:38,
                   from /usr/include/c++/5/sstream:38,
                   from /usr/include/c++/5/complex:45,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Core:80,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Dense:1,
                   from test.cpp:1:
  /usr/include/c++/5/bits/stl_function.h: In instantiation of ‘bool std::less&lt;_Tp&gt;::operator()(const _Tp&amp;, const _Tp&amp;) const [with _Tp = Eigen::Matrix&lt;double, -1, 1&gt;]’:
  test.cpp:36:26:   required from here
  /usr/include/c++/5/bits/stl_function.h:387:20: error: no match for ‘operator&lt;’ (operand types are ‘const Eigen::Matrix&lt;double, -1, 1&gt;’ and ‘const Eigen::Matrix&lt;double, -1, 1&gt;’)
         { return __x &lt; __y; }
                      ^
  In file included from /usr/include/c++/5/bits/stl_algobase.h:64:0,
                   from /usr/include/c++/5/bits/char_traits.h:39,
                   from /usr/include/c++/5/ios:40,
                   from /usr/include/c++/5/istream:38,
                   from /usr/include/c++/5/sstream:38,
                   from /usr/include/c++/5/complex:45,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Core:80,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Dense:1,
                   from test.cpp:1:
  /usr/include/c++/5/bits/stl_pair.h:220:5: note: candidate: template&lt;class _T1, class _T2&gt; constexpr bool std::operator&lt;(const std::pair&lt;_T1, _T2&gt;&amp;, const std::pair&lt;_T1, _T2&gt;&amp;)
       operator&lt;(const pair&lt;_T1, _T2&gt;&amp; __x, const pair&lt;_T1, _T2&gt;&amp; __y)
       ^
  /usr/include/c++/5/bits/stl_pair.h:220:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/5/string:48:0,
                   from /usr/include/c++/5/bits/locale_classes.h:40,
                   from /usr/include/c++/5/bits/ios_base.h:41,
                   from /usr/include/c++/5/ios:42,
                   from /usr/include/c++/5/istream:38,
                   from /usr/include/c++/5/sstream:38,
                   from /usr/include/c++/5/complex:45,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Core:80,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Dense:1,
                   from test.cpp:1:
  /usr/include/c++/5/bits/stl_function.h:387:20: note:   ‘const Eigen::Matrix&lt;double, -1, 1&gt;’ is not derived from ‘const std::pair&lt;_T1, _T2&gt;’
         { return __x &lt; __y; }
                      ^
  In file included from /usr/include/c++/5/bits/stl_algobase.h:67:0,
                   from /usr/include/c++/5/bits/char_traits.h:39,
                   from /usr/include/c++/5/ios:40,
                   from /usr/include/c++/5/istream:38,
                   from /usr/include/c++/5/sstream:38,
                   from /usr/include/c++/5/complex:45,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Core:80,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Dense:1,
                   from test.cpp:1:
  /usr/include/c++/5/bits/stl_iterator.h:298:5: note: candidate: template&lt;class _Iterator&gt; bool std::operator&lt;(const std::reverse_iterator&lt;_Iterator&gt;&amp;, const std::reverse_iterator&lt;_Iterator&gt;&amp;)
       operator&lt;(const reverse_iterator&lt;_Iterator&gt;&amp; __x,
       ^
  /usr/include/c++/5/bits/stl_iterator.h:298:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/5/string:48:0,
                   from /usr/include/c++/5/bits/locale_classes.h:40,
                   from /usr/include/c++/5/bits/ios_base.h:41,
                   from /usr/include/c++/5/ios:42,
                   from /usr/include/c++/5/istream:38,
                   from /usr/include/c++/5/sstream:38,
                   from /usr/include/c++/5/complex:45,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Core:80,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Dense:1,
                   from test.cpp:1:
  /usr/include/c++/5/bits/stl_function.h:387:20: note:   ‘const Eigen::Matrix&lt;double, -1, 1&gt;’ is not derived from ‘const std::reverse_iterator&lt;_Iterator&gt;’
         { return __x &lt; __y; }
                      ^
  In file included from /usr/include/c++/5/bits/stl_algobase.h:67:0,
                   from /usr/include/c++/5/bits/char_traits.h:39,
                   from /usr/include/c++/5/ios:40,
                   from /usr/include/c++/5/istream:38,
                   from /usr/include/c++/5/sstream:38,
                   from /usr/include/c++/5/complex:45,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Core:80,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Dense:1,
                   from test.cpp:1:
  /usr/include/c++/5/bits/stl_iterator.h:348:5: note: candidate: template&lt;class _IteratorL, class _IteratorR&gt; bool std::operator&lt;(const std::reverse_iterator&lt;_Iterator&gt;&amp;, const std::reverse_iterator&lt;_IteratorR&gt;&amp;)
       operator&lt;(const reverse_iterator&lt;_IteratorL&gt;&amp; __x,
       ^
  /usr/include/c++/5/bits/stl_iterator.h:348:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/5/string:48:0,
                   from /usr/include/c++/5/bits/locale_classes.h:40,
                   from /usr/include/c++/5/bits/ios_base.h:41,
                   from /usr/include/c++/5/ios:42,
                   from /usr/include/c++/5/istream:38,
                   from /usr/include/c++/5/sstream:38,
                   from /usr/include/c++/5/complex:45,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Core:80,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Dense:1,
                   from test.cpp:1:
  /usr/include/c++/5/bits/stl_function.h:387:20: note:   ‘const Eigen::Matrix&lt;double, -1, 1&gt;’ is not derived from ‘const std::reverse_iterator&lt;_Iterator&gt;’
         { return __x &lt; __y; }
                      ^
  In file included from /usr/include/c++/5/bits/stl_algobase.h:67:0,
                   from /usr/include/c++/5/bits/char_traits.h:39,
                   from /usr/include/c++/5/ios:40,
                   from /usr/include/c++/5/istream:38,
                   from /usr/include/c++/5/sstream:38,
                   from /usr/include/c++/5/complex:45,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Core:80,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Dense:1,
                   from test.cpp:1:
  /usr/include/c++/5/bits/stl_iterator.h:1089:5: note: candidate: template&lt;class _IteratorL, class _IteratorR&gt; bool std::operator&lt;(const std::move_iterator&lt;_Iterator&gt;&amp;, const std::move_iterator&lt;_IteratorR&gt;&amp;)
       operator&lt;(const move_iterator&lt;_IteratorL&gt;&amp; __x,
       ^
  /usr/include/c++/5/bits/stl_iterator.h:1089:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/5/string:48:0,
                   from /usr/include/c++/5/bits/locale_classes.h:40,
                   from /usr/include/c++/5/bits/ios_base.h:41,
                   from /usr/include/c++/5/ios:42,
                   from /usr/include/c++/5/istream:38,
                   from /usr/include/c++/5/sstream:38,
                   from /usr/include/c++/5/complex:45,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Core:80,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Dense:1,
                   from test.cpp:1:
  /usr/include/c++/5/bits/stl_function.h:387:20: note:   ‘const Eigen::Matrix&lt;double, -1, 1&gt;’ is not derived from ‘const std::move_iterator&lt;_Iterator&gt;’
         { return __x &lt; __y; }
                      ^
  In file included from /usr/include/c++/5/bits/stl_algobase.h:67:0,
                   from /usr/include/c++/5/bits/char_traits.h:39,
                   from /usr/include/c++/5/ios:40,
                   from /usr/include/c++/5/istream:38,
                   from /usr/include/c++/5/sstream:38,
                   from /usr/include/c++/5/complex:45,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Core:80,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Dense:1,
                   from test.cpp:1:
  /usr/include/c++/5/bits/stl_iterator.h:1095:5: note: candidate: template&lt;class _Iterator&gt; bool std::operator&lt;(const std::move_iterator&lt;_Iterator&gt;&amp;, const std::move_iterator&lt;_Iterator&gt;&amp;)
       operator&lt;(const move_iterator&lt;_Iterator&gt;&amp; __x,
       ^
  /usr/include/c++/5/bits/stl_iterator.h:1095:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/5/string:48:0,
                   from /usr/include/c++/5/bits/locale_classes.h:40,
                   from /usr/include/c++/5/bits/ios_base.h:41,
                   from /usr/include/c++/5/ios:42,
                   from /usr/include/c++/5/istream:38,
                   from /usr/include/c++/5/sstream:38,
                   from /usr/include/c++/5/complex:45,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Core:80,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Dense:1,
                   from test.cpp:1:
  /usr/include/c++/5/bits/stl_function.h:387:20: note:   ‘const Eigen::Matrix&lt;double, -1, 1&gt;’ is not derived from ‘const std::move_iterator&lt;_Iterator&gt;’
         { return __x &lt; __y; }
                      ^
  In file included from /usr/include/c++/5/string:52:0,
                   from /usr/include/c++/5/bits/locale_classes.h:40,
                   from /usr/include/c++/5/bits/ios_base.h:41,
                   from /usr/include/c++/5/ios:42,
                   from /usr/include/c++/5/istream:38,
                   from /usr/include/c++/5/sstream:38,
                   from /usr/include/c++/5/complex:45,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Core:80,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Dense:1,
                   from test.cpp:1:
  /usr/include/c++/5/bits/basic_string.h:4987:5: note: candidate: template&lt;class _CharT, class _Traits, class _Alloc&gt; bool std::operator&lt;(const std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;, const std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;)
       operator&lt;(const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __lhs,
       ^
  /usr/include/c++/5/bits/basic_string.h:4987:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/5/string:48:0,
                   from /usr/include/c++/5/bits/locale_classes.h:40,
                   from /usr/include/c++/5/bits/ios_base.h:41,
                   from /usr/include/c++/5/ios:42,
                   from /usr/include/c++/5/istream:38,
                   from /usr/include/c++/5/sstream:38,
                   from /usr/include/c++/5/complex:45,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Core:80,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Dense:1,
                   from test.cpp:1:
  /usr/include/c++/5/bits/stl_function.h:387:20: note:   ‘const Eigen::Matrix&lt;double, -1, 1&gt;’ is not derived from ‘const std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;’
         { return __x &lt; __y; }
                      ^
  In file included from /usr/include/c++/5/string:52:0,
                   from /usr/include/c++/5/bits/locale_classes.h:40,
                   from /usr/include/c++/5/bits/ios_base.h:41,
                   from /usr/include/c++/5/ios:42,
                   from /usr/include/c++/5/istream:38,
                   from /usr/include/c++/5/sstream:38,
                   from /usr/include/c++/5/complex:45,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Core:80,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Dense:1,
                   from test.cpp:1:
  /usr/include/c++/5/bits/basic_string.h:4999:5: note: candidate: template&lt;class _CharT, class _Traits, class _Alloc&gt; bool std::operator&lt;(const std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;, const _CharT*)
       operator&lt;(const basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp; __lhs,
       ^
  /usr/include/c++/5/bits/basic_string.h:4999:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/5/string:48:0,
                   from /usr/include/c++/5/bits/locale_classes.h:40,
                   from /usr/include/c++/5/bits/ios_base.h:41,
                   from /usr/include/c++/5/ios:42,
                   from /usr/include/c++/5/istream:38,
                   from /usr/include/c++/5/sstream:38,
                   from /usr/include/c++/5/complex:45,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Core:80,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Dense:1,
                   from test.cpp:1:
  /usr/include/c++/5/bits/stl_function.h:387:20: note:   ‘const Eigen::Matrix&lt;double, -1, 1&gt;’ is not derived from ‘const std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;’
         { return __x &lt; __y; }
                      ^
  In file included from /usr/include/c++/5/string:52:0,
                   from /usr/include/c++/5/bits/locale_classes.h:40,
                   from /usr/include/c++/5/bits/ios_base.h:41,
                   from /usr/include/c++/5/ios:42,
                   from /usr/include/c++/5/istream:38,
                   from /usr/include/c++/5/sstream:38,
                   from /usr/include/c++/5/complex:45,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Core:80,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Dense:1,
                   from test.cpp:1:
  /usr/include/c++/5/bits/basic_string.h:5011:5: note: candidate: template&lt;class _CharT, class _Traits, class _Alloc&gt; bool std::operator&lt;(const _CharT*, const std::__cxx11::basic_string&lt;_CharT, _Traits, _Alloc&gt;&amp;)
       operator&lt;(const _CharT* __lhs,
       ^
  /usr/include/c++/5/bits/basic_string.h:5011:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/5/string:48:0,
                   from /usr/include/c++/5/bits/locale_classes.h:40,
                   from /usr/include/c++/5/bits/ios_base.h:41,
                   from /usr/include/c++/5/ios:42,
                   from /usr/include/c++/5/istream:38,
                   from /usr/include/c++/5/sstream:38,
                   from /usr/include/c++/5/complex:45,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Core:80,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Dense:1,
                   from test.cpp:1:
  /usr/include/c++/5/bits/stl_function.h:387:20: note:   mismatched types ‘const _CharT*’ and ‘Eigen::Matrix&lt;double, -1, 1&gt;’
         { return __x &lt; __y; }
                      ^
  In file included from /usr/include/c++/5/bits/ios_base.h:46:0,
                   from /usr/include/c++/5/ios:42,
                   from /usr/include/c++/5/istream:38,
                   from /usr/include/c++/5/sstream:38,
                   from /usr/include/c++/5/complex:45,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Core:80,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Dense:1,
                   from test.cpp:1:
  /usr/include/c++/5/system_error:200:3: note: candidate: bool std::operator&lt;(const std::error_code&amp;, const std::error_code&amp;)
     operator&lt;(const error_code&amp; __lhs, const error_code&amp; __rhs) noexcept
     ^
  /usr/include/c++/5/system_error:200:3: note:   no known conversion for argument 1 from ‘const Eigen::Matrix&lt;double, -1, 1&gt;’ to ‘const std::error_code&amp;’
  /usr/include/c++/5/system_error:274:3: note: candidate: bool std::operator&lt;(const std::error_condition&amp;, const std::error_condition&amp;)
     operator&lt;(const error_condition&amp; __lhs,
     ^
  /usr/include/c++/5/system_error:274:3: note:   no known conversion for argument 1 from ‘const Eigen::Matrix&lt;double, -1, 1&gt;’ to ‘const std::error_condition&amp;’
  In file included from /usr/include/c++/5/tuple:39:0,
                   from /usr/include/c++/5/functional:55,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Core:262,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Dense:1,
                   from test.cpp:1:
  /usr/include/c++/5/array:250:5: note: candidate: template&lt;class _Tp, long unsigned int _Nm&gt; bool std::operator&lt;(const std::array&lt;_Tp, _Nm&gt;&amp;, const std::array&lt;_Tp, _Nm&gt;&amp;)
       operator&lt;(const array&lt;_Tp, _Nm&gt;&amp; __a, const array&lt;_Tp, _Nm&gt;&amp; __b)
       ^
  /usr/include/c++/5/array:250:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/5/string:48:0,
                   from /usr/include/c++/5/bits/locale_classes.h:40,
                   from /usr/include/c++/5/bits/ios_base.h:41,
                   from /usr/include/c++/5/ios:42,
                   from /usr/include/c++/5/istream:38,
                   from /usr/include/c++/5/sstream:38,
                   from /usr/include/c++/5/complex:45,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Core:80,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Dense:1,
                   from test.cpp:1:
  /usr/include/c++/5/bits/stl_function.h:387:20: note:   ‘const Eigen::Matrix&lt;double, -1, 1&gt;’ is not derived from ‘const std::array&lt;_Tp, _Nm&gt;’
         { return __x &lt; __y; }
                      ^
  In file included from /usr/include/c++/5/functional:55:0,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Core:262,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Dense:1,
                   from test.cpp:1:
  /usr/include/c++/5/tuple:928:5: note: candidate: template&lt;class ... _TElements, class ... _UElements&gt; constexpr bool std::operator&lt;(const std::tuple&lt;_Elements ...&gt;&amp;, const std::tuple&lt;_Elements ...&gt;&amp;)
       operator&lt;(const tuple&lt;_TElements...&gt;&amp; __t,
       ^
  /usr/include/c++/5/tuple:928:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/5/string:48:0,
                   from /usr/include/c++/5/bits/locale_classes.h:40,
                   from /usr/include/c++/5/bits/ios_base.h:41,
                   from /usr/include/c++/5/ios:42,
                   from /usr/include/c++/5/istream:38,
                   from /usr/include/c++/5/sstream:38,
                   from /usr/include/c++/5/complex:45,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Core:80,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Dense:1,
                   from test.cpp:1:
  /usr/include/c++/5/bits/stl_function.h:387:20: note:   ‘const Eigen::Matrix&lt;double, -1, 1&gt;’ is not derived from ‘const std::tuple&lt;_Elements ...&gt;’
         { return __x &lt; __y; }
                      ^
  In file included from /usr/include/c++/5/vector:64:0,
                   from /usr/include/c++/5/bits/random.h:34,
                   from /usr/include/c++/5/random:49,
                   from /usr/include/c++/5/bits/stl_algo.h:66,
                   from /usr/include/c++/5/algorithm:62,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Core:269,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Dense:1,
                   from test.cpp:1:
  /usr/include/c++/5/bits/stl_vector.h:1528:5: note: candidate: template&lt;class _Tp, class _Alloc&gt; bool std::operator&lt;(const std::vector&lt;_Tp, _Alloc&gt;&amp;, const std::vector&lt;_Tp, _Alloc&gt;&amp;)
       operator&lt;(const vector&lt;_Tp, _Alloc&gt;&amp; __x, const vector&lt;_Tp, _Alloc&gt;&amp; __y)
       ^
  /usr/include/c++/5/bits/stl_vector.h:1528:5: note:   template argument deduction/substitution failed:
  In file included from /usr/include/c++/5/string:48:0,
                   from /usr/include/c++/5/bits/locale_classes.h:40,
                   from /usr/include/c++/5/bits/ios_base.h:41,
                   from /usr/include/c++/5/ios:42,
                   from /usr/include/c++/5/istream:38,
                   from /usr/include/c++/5/sstream:38,
                   from /usr/include/c++/5/complex:45,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Core:80,
                   from /home/alaya/.softwares/linear_algebra/eigen3.3/include/eigen3/Eigen/Dense:1,
                   from test.cpp:1:
  /usr/include/c++/5/bits/stl_function.h:387:20: note:   ‘const Eigen::Matrix&lt;double, -1, 1&gt;’ is not derived from ‘const std::vector&lt;_Tp, _Alloc&gt;’
         { return __x &lt; __y; }
                      ^
  make: *** [try] Error 1
  </code></pre>
  
  <p>I am using g++ 5.4.0 and Eigen 3.3</p>