std::ranges::take_while_view<V,Pred>::pred
From cppreference.com
 
 
 < cpp | ranges | take while view 
 
 
 C++ 
 Feature test macros (C++20)
 Concepts library (C++20)
 Metaprogramming library (C++11)
 Ranges library (C++20)
 Filesystem library (C++17)
 Concurrency support library (C++11)
 Execution control library (C++26)
Ranges library 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
(C++23)(C++23)
  (C++26)(C++26)
(C++23)(C++23)
  (C++26)(C++26)
(C++26)(C++26)
  (C++23)(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++23)(C++23)
  (C++23)(C++23)
(C++23)
(C++23)(C++23)
(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++23)(C++23)
(C++23)(C++23)
constexpr const Pred& pred() const;
 
 (since C++20) 
Returns a reference to the stored predicate pred_.
If *this does not store a predicate (e.g. an exception is thrown on the assignment to *this, which copy-constructs or move-constructs a Pred), the behavior is undefined.
Contents
[edit] Parameters
(none)
[edit] Return value
A reference to the stored predicate.
[edit] Example
Run this code
#include <ranges> int main() { static constexpr int a[]{1, 2, 3, 4, 5}; constexpr auto v = a | std::views::take_while ([](int x){ return x < 4; }); const auto pred = v.pred(); static_assert(pred(3)); }