title: constexpr algorithm all_of compiler error
body: <p>I have this small piece of code:</p>
  
  <pre><code>void all_of_examples() {
    using std::begin;
    using std::end;
  
    //C++17 
    //template&lt; class InputIt, class UnaryPredicate &gt;
    //constexpr bool all_of( InputIt first, InputIt last, UnaryPredicate p );
  
    constexpr auto v2 = std::array&lt;int, 4&gt;{1, 1, 1, 1};
    constexpr auto eqOne = [](int x) constexpr { 
                            constexpr int one = 1;
                            return x == one; 
                         };
  
    constexpr bool isAllV2 = std::all_of(begin(v2), end(v2), eqOne);
  
    std::cout &lt;&lt; isAllV2 &lt;&lt; std::flush &lt;&lt; '\n';
  }
  </code></pre>
  
  <p>gcc-8 issues a diagnostic(clang issues a similar error as well):</p>
  
  <blockquote>
    <p>examples.cpp:21:41: error: call to non-'constexpr' function 'bool std::all_of(_IIter, _IIter, _Predicate) [with _IIter = const int*; _Predicate = algo::all_of_examples()::]'
         constexpr bool isAllV2 = std::all_of(begin(v2), end(v2), eqOne);</p>
  </blockquote>
  
  <p>I know that lamdas since C++17 can be constexpr and also <code>std::begin</code> &amp;&amp; <code>std::end</code> are both marked as <code>constexpr</code>. Furthermore, <code>std::array</code> can also be constexpr. Therefore, why the compiler doesn't pick the constexpr version of <code>std::all_of</code> and complains that it isn't? </p>