derived view is not empty. Provided if  [ ranges::empty ](/w/cpp/ranges/empty "cpp/ranges/empty") is applicable to it.   
(public member function of ` std::ranges::view_interface<D> ` )  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/view_interface/dsc_operator_bool&action=edit)  
[ front  ](/w/cpp/ranges/view_interface/front "cpp/ranges/view interface/front") (C++20)  |  returns the first element in the derived view. Provided if it satisfies [ ` forward_range ` ](/w/cpp/ranges/forward_range "cpp/ranges/forward range") .   
(public member function of ` std::ranges::view_interface<D> ` )  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/view_interface/dsc_front&action=edit)  
[ back  ](/w/cpp/ranges/view_interface/back "cpp/ranges/view interface/back") (C++20)  |  returns the last element in the derived view. Provided if it satisfies [ ` bidirectional_range ` ](/w/cpp/ranges/bidirectional_range "cpp/ranges/bidirectional range") and [ ` common_range ` ](/w/cpp/ranges/common_range "cpp/ranges/common range") .   
(public member function of ` std::ranges::view_interface<D> ` )  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/view_interface/dsc_back&action=edit)  
  
##  std::ranges::filter_view::  filter_view

filter_view  (  )  requires [ std::  default_initializable
](http://en.cppreference.com/w/cpp/concepts/default_initializable) < V  > &&  
[ std::  default_initializable  ](http://en.cppreference.com/w/cpp/concepts/default_initializable) < Pred  > =  default  ;  |  (1)  |  (since C++20)   
---|---|---  
constexpr  explicit  filter_view  (  V base, Pred pred  )  ;  |  (2)  |  (since C++20)   
|  |   
  
1)  Value-initializes ` _base__ ` via its default member initializer (  =  V
(  )  ) and default-initializes ` _pred__ ` (which value-initializes the
contained ` Pred ` ).

2)  Initializes ` _base__ ` with  std  ::  move  (  base  )  and initializes `
_pred__ ` with  std  ::  move  (  pred  )  .

###  Parameters

base  |  \-  |  range to filter   
---|---|---  
pred  |  \-  |  predicate to filter out elements   
  
##  std::ranges::filter_view::  base

constexpr  V base  (  )  const  & requires [ std::  copy_constructible  ](http://en.cppreference.com/w/cpp/concepts/copy_constructible) < V  > ;  |  (1)  |  (since C++20)   
---|---|---  
constexpr  V base  (  )  && ;  |  (2)  |  (since C++20)   
|  |   
  
1)  Equivalent to  return  base_  ;  .

2)  Equivalent to  return  std  ::  move  (  base_  )  ;  .

##  std::ranges::filter_view::  pred

constexpr  const  Pred  & pred  (  )  const  ;  |  |  (since C++20)   
---|---|---  
|  |   
  
Returns a reference to the contained ` Pred ` object. The behavior is
undefined if ` _pred__ ` does not contain a value.

##  std::ranges::filter_view::  begin

constexpr  /* iterator */  begin  (  )  ;  |  |  (  exposition only*  )   
---|---|---  
|  |   
  
In order to provide the amortized constant time complexity required by the [ `
range ` ](/w/cpp/ranges/range "cpp/ranges/range") concept, this function
caches the result within the ` filter_view ` object for use on subsequent
calls. Equivalent to

    
    
    if constexpr (![ranges::forward_range](http://en.cppreference.com/w/cpp/ranges/forward_range)<V>)
        return /* iterator */{*this, [ranges::find_if](http://en.cppreference.com/w/cpp/algorithm/ranges/find)(base_, [std::ref](http://en.cppreference.com/w/cpp/utility/functional/ref)(*pred_))};
    else
    {
        if (!begin_.has_value())
            begin_ = [ranges::find_if](http://en.cppreference.com/w/cpp/algorithm/ranges/find)(base_, [std::ref](http://en.cppreference.com/w/cpp/utility/functional/ref)(*pred_)); // caching
        return /* iterator */{*this, begin_.value())};
    }

The behavior is undefined if ` _pred__ ` does not contain a value.

##  std::ranges::filter_view::  end

constexpr  auto  end  (  )  ;  |  |  (since C++20)   
---|---|---  
|  |   
  
Returns an iterat