erence.com/w/cpp/ranges/view)
V  >  
requires  (  not [ ranges::  common_range
](http://en.cppreference.com/w/cpp/ranges/common_range) < V  > and  
[ std::  copyable  ](http://en.cppreference.com/w/cpp/concepts/copyable) < [
ranges::  iterator_t  ](http://en.cppreference.com/w/cpp/ranges-ranges-
placeholder/iterator_t) < V  >> )  
class  common_view  
:  public  [ ranges::  view_interface  ](http://en.cppreference.com/w/cpp/ranges/view_interface) < common_view  < V  >> |  (1)  |  (since C++20)   
namespace  views  {  
inline  constexpr  /* unspecified */  common  =  /* unspecified */  ;  
}  |  (2)  |  (since C++20)   
Call signature  |  |   
template  < [ ranges::  viewable_range
](http://en.cppreference.com/w/cpp/ranges/viewable_range) R  >  
requires  /* see below */  
constexpr  [ ranges::  view  ](http://en.cppreference.com/w/cpp/ranges/view) auto  common  (  R  && r  )  ;  |  |  (since C++20)   
|  |   
  
1)  Adapts a given [ ` view ` ](/w/cpp/ranges/view "cpp/ranges/view") with
different types for iterator/sentinel pair into a [ ` view `
](/w/cpp/ranges/view "cpp/ranges/view") that is also a [ ` common_range `
](/w/cpp/ranges/common_range "cpp/ranges/common range") . A ` common_view `
always has the same iterator/sentinel type.

2)  [ RangeAdaptorObject  ](/w/cpp/named_req/RangeAdaptorObject "cpp/named
req/RangeAdaptorObject") . Let  e  be a subexpression. Then the expression
views  ::  common  (  e  )  is [ expression-equivalent
](/w/cpp/language/expressions#Expression-equivalence
"cpp/language/expressions") to:

  * [ views::  all  ](http://en.cppreference.com/w/cpp/ranges/all_view) (  e  )  , if it is a well-formed expression and  decltype  (  (  e  )  )  models [ ` common_range ` ](/w/cpp/ranges/common_range "cpp/ranges/common range") ; 
  * common_view  {  e  }  otherwise. 

##  Contents

  * 1  Data members 
  * 2  Member functions 
    * 2.1  Inherited from  std::ranges::view_interface 
  * 3  Deduction guides 
  * 4  Helper templates 
  * 5  Notes 
  * 6  Example 
  * 7  Defect reports 
  * 8  See also 

  
---  
  
###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/common_view&action=edit&section=1 "Edit
section: Data members") ]  Data members

Member name  |  Definition   
---|---  
` _base__ ` (private)  |  The underlying view of type ` V ` .   
(  exposition-only member object*  )  
  
###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/common_view&action=edit&section=2 "Edit
section: Member functions") ]  Member functions

[ (constructor)  ](/w/cpp/ranges/common_view/common_view "cpp/ranges/common view/common view") (C++20)  |  constructs a ` common_view `   
(public member function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/adaptor/dsc_constructor&action=edit)  
---|---  
[ base  ](/w/cpp/ranges/common_view/base "cpp/ranges/common view/base") (C++20)  |  returns a copy of the underlying (adapted) view   
(public member function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/adaptor/dsc_base&action=edit)  
[ begin  ](/w/cpp/ranges/common_view/begin "cpp/ranges/common view/begin") (C++20)  |  returns an iterator to the beginning   
(public member function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/adaptor/dsc_begin&action=edit)  
[ end  ](/w/cpp/ranges/common_view/end "cpp/ranges/common view/end") (C++20)  |  returns an iterator to the end   
(public member function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/adaptor/dsc_end&action=edit)  
[ size  ](/w/cpp/ranges/common_view/size "cpp/ranges/common view/size") (C++20)  |  returns the number of elements. Provided only if the underlying (adapted) range satisfies [ ` sized_range ` ](/w/cpp/ranges/sized_range "cpp/ranges/sized range") .   
(public member function)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/adaptor/dsc_size&action=edit)  
  
#####  Inherited from  [ std::ran