guous_range  concept is a refinement of [ ` range `
](/w/cpp/ranges/range "cpp/ranges/range") for which  ranges::begin  returns a
model of [ ` contiguous_iterator ` ](/w/cpp/iterator/contiguous_iterator
"cpp/iterator/contiguous iterator") and the customization point  [ ranges::
data  ](http://en.cppreference.com/w/cpp/ranges-ranges-placeholder/data) is
usable.

###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/contiguous_range&action=edit&section=1
"Edit section: Semantic requirements") ]  Semantic requirements

` T ` models  contiguous_range  only if given an expression ` e ` such that
decltype  (  (  e  )  )  is  T  & ,  [ std::  to_address
](http://en.cppreference.com/w/cpp/memory/to_address) (  [ ranges::  begin
](http://en.cppreference.com/w/cpp/ranges-ranges-placeholder/begin) (  e  )  )
==  [ ranges::  data  ](http://en.cppreference.com/w/cpp/ranges-ranges-
placeholder/data) (  e  )  .

###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/contiguous_range&action=edit&section=2
"Edit section: Example") ]  Example

Run this code

    
    
    #include <array>
    #include <deque>
    #include <list>
    #include <ranges>
    #include <set>
    #include <valarray>
    #include <vector>
     
    template<typename T> concept CR = std::ranges::contiguous_range<T>;
     
    int main()
    {
        int a[4];
        static_assert(
                CR<[std::vector](http://en.cppreference.com/w/cpp/container/vector)<int>> and
            not CR<[std::vector](http://en.cppreference.com/w/cpp/container/vector)<bool>> and
            not CR<[std::deque](http://en.cppreference.com/w/cpp/container/deque)<int>> and
                CR<[std::valarray](http://en.cppreference.com/w/cpp/numeric/valarray)<int>> and
                CR<decltype(a)> and
            not CR<[std::list](http://en.cppreference.com/w/cpp/container/list)<int>> and
            not CR<[std::set](http://en.cppreference.com/w/cpp/container/set)<int>> and
                CR<[std::array](http://en.cppreference.com/w/cpp/container/array)<[std::list](http://en.cppreference.com/w/cpp/container/list)<int>,42>>
        );
    }

###  [ [ edit
](/mwiki/index.php?title=cpp/ranges/contiguous_range&action=edit&section=3
"Edit section: See also") ]  See also

[ ranges::sized_range  ](/w/cpp/ranges/sized_range "cpp/ranges/sized range") (C++20)  |  specifies that a range knows its size in constant time   
(concept)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/dsc_sized_range&action=edit)  
---|---  
[ ranges::random_access_range  ](/w/cpp/ranges/random_access_range "cpp/ranges/random access range") (C++20)  |  specifies a range whose iterator type satisfies [ ` random_access_iterator ` ](/w/cpp/iterator/random_access_iterator "cpp/iterator/random access iterator")   
(concept)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/dsc_random_access_range&action=edit)  
  
Retrieved from " [
https://en.cppreference.com/mwiki/index.php?title=cpp/ranges/contiguous_range&oldid=151100
](https://en.cppreference.com/mwiki/index.php?title=cpp/ranges/contiguous_range&oldid=151100)
"

#####  Navigation

  * [ Support us ](http://www.cppreference.com/support)
  * [ Recent changes ](/w/Special:RecentChanges "A list of recent changes in the wiki \[r\]")
  * [ FAQ ](/w/Cppreference:FAQ)
  * [ Offline version ](/w/Cppreference:Archives)

#####  Toolbox

  * [ What links here ](/w/Special:WhatLinksHere/cpp/ranges/contiguous_range "A list of all wiki pages that link here \[j\]")
  * [ Related changes ](/w/Special:RecentChangesLinked/cpp/ranges/contiguous_range "Recent changes in pages linked from this page \[k\]")
  * [ Upload file ](http://upload.cppreference.com/w/Special:Upload "Upload files \[u\]")
  * [ Special pages ](/w/Special:SpecialPages "A list of all special pages \[q\]")
  * [ Printable version ](/mwiki/index.php?title=cpp/ranges/contiguous_range&printable=yes "Printable version of this page \[p\]")
  * [ Permanent link ](/mw