) `  
Defined in header ` [ <set> ](/w/cpp/header/set "cpp/header/set") `  
Defined in header ` [ <span> ](/w/cpp/header/span "cpp/header/span") `  
Defined in header ` [ <string> ](/w/cpp/header/string "cpp/header/string") `  
Defined in header ` [ <string_view> ](/w/cpp/header/string_view
"cpp/header/string view") `  
Defined in header ` [ <unordered_map> ](/w/cpp/header/unordered_map
"cpp/header/unordered map") `  
Defined in header ` [ <unordered_set> ](/w/cpp/header/unordered_set
"cpp/header/unordered set") `  
Defined in header ` [ <vector> ](/w/cpp/header/vector "cpp/header/vector") `  
Defined in namespace ` std `  
[ begin  cbegin  ](/w/cpp/iterator/begin "cpp/iterator/begin") (C++11)  (C++14)  |  returns an iterator to the beginning of a container or array   
(function template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/iterator/dsc_begin&action=edit)  
[ end  cend  ](/w/cpp/iterator/end "cpp/iterator/end") (C++11)  (C++14)  |  returns an iterator to the end of a container or array   
(function template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/iterator/dsc_end&action=edit)  
[ rbegin  crbegin  ](/w/cpp/iterator/rbegin "cpp/iterator/rbegin") (C++14)  |  returns a reverse iterator to the beginning of a container or array   
(function template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/iterator/dsc_rbegin&action=edit)  
[ rend  crend  ](/w/cpp/iterator/rend "cpp/iterator/rend") (C++14)  |  returns a reverse end iterator for a container or array   
(function template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/iterator/dsc_rend&action=edit)  
[ size  ssize  ](/w/cpp/iterator/size "cpp/iterator/size") (C++17)  (C++20)  |  returns the size of a container or array   
(function template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/iterator/dsc_size&action=edit)  
[ empty  ](/w/cpp/iterator/empty "cpp/iterator/empty") (C++17)  |  checks whether the container is empty   
(function template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/iterator/dsc_empty&action=edit)  
[ data  ](/w/cpp/iterator/data "cpp/iterator/data") (C++17)  |  obtains the pointer to the underlying array   
(function template)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/iterator/dsc_data&action=edit)  
  
###  [ [ edit ](/mwiki/index.php?title=cpp/iterator&action=edit&section=17
"Edit section: Defect reports") ]  Defect reports

The following behavior-changing defect reports were applied retroactively to
previously published C++ standards.

DR  |  Applied to  |  Behavior as published  |  Correct behavior   
---|---|---|---  
[ CWG 1181 ](https://cplusplus.github.io/CWG/issues/1181.html) |  C++98  |  array types could not be value types  |  they can   
[ LWG 208 ](https://cplusplus.github.io/LWG/issue208) |  C++98  |  past-the-end iterators were always non-singular  |  they can be singular   
[ LWG 278 ](https://cplusplus.github.io/LWG/issue278) |  C++98  |  the validity of an iterator was not defined  |  defined to be always non-singular   
[ LWG 324 ](https://cplusplus.github.io/LWG/issue324) |  C++98  |  output iterators had value types  |  output iterators have writable types instead   
[ LWG 407 ](https://cplusplus.github.io/LWG/issue407) |  C++98  |  singular iterators could not be destroyed  |  allowed   
[ LWG 408 ](https://cplusplus.github.io/LWG/issue408)  
( [ N3066 ](https://wg21.link/N3066) )  |  C++98  |  singular iterators could not be copied  |  allowed if they are value-initialized   
[ LWG 1185 ](https://cplusplus.github.io/LWG/issue1185)  
( [ N3066 ](https://wg21.link/N3066) )  |  C++98  |  [ LegacyForwardIterator  ](/w/cpp/named_req/ForwardIterator "cpp/named req/ForwardIterator") , [ LegacyBidirectionalIterator  ](/w/cpp/named_req/BidirectionalIterator "cpp/named req/BidirectionalIterator")   
and [ LegacyRandomAcce