"s = " << s << '\n';
    }

Output:

    
    
    ranges::ssize(arr) = 5
    ranges::ssize is signed
    reversed arr: 5 4 3 2 1
    s = -1

###  [ [ edit ](/mwiki/index.php?title=cpp/ranges/ssize&action=edit&section=3
"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   
---|---|---|---  
[ LWG 3403 ](https://cplusplus.github.io/LWG/issue3403) |  C++20  |  ` ranges::size ` worked for some non-range types but ` ranges::ssize ` didn't  |  made work   
  
###  [ [ edit ](/mwiki/index.php?title=cpp/ranges/ssize&action=edit&section=4
"Edit section: See also") ]  See also

[ ranges::size  ](/w/cpp/ranges/size "cpp/ranges/size") (C++20)  |  returns an integer equal to the size of a range   
(customization point object)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/ranges/dsc_size&action=edit)  
---|---  
[ 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::distance  ](/w/cpp/iterator/ranges/distance "cpp/iterator/ranges/distance") (C++20)  |  returns the distance between an iterator and a sentinel, or between the beginning and end of a range   
(niebloid)  [ [edit]
](https://en.cppreference.com/mwiki/index.php?title=Template:cpp/iterator/ranges/dsc_distance&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)  
  
Retrieved from " [
https://en.cppreference.com/mwiki/index.php?title=cpp/ranges/ssize&oldid=160935
](https://en.cppreference.com/mwiki/index.php?title=cpp/ranges/ssize&oldid=160935)
"

#####  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/ssize "A list of all wiki pages that link here \[j\]")
  * [ Related changes ](/w/Special:RecentChangesLinked/cpp/ranges/ssize "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/ssize&printable=yes "Printable version of this page \[p\]")
  * [ Permanent link ](/mwiki/index.php?title=cpp/ranges/ssize&oldid=160935 "Permanent link to this revision of the page")
  * [ Page information ](/mwiki/index.php?title=cpp/ranges/ssize&action=info)

  * In other languages 

  * [ Español ](http://es.cppreference.com/w/cpp/ranges/ssize "cpp/ranges/ssize")
  * [ 日本語 ](http://ja.cppreference.com/w/cpp/ranges/ssize "cpp/ranges/ssize")
  * [ Русский ](http://ru.cppreference.com/w/cpp/ranges/ssize "cpp/ranges/ssize")
  * [ 中文 ](http://zh.cppreference.com/w/cpp/ranges/ssize "cpp/ranges/ssize")

  * This page was last modified on 19 October 2023, at 01:41. 
  * This page has been accessed 16,867 times. 

  * [ Privacy policy ](/w/Cppreference:Privacy_policy "Cppreference:Privacy policy")
  * [ About cppreference.com ](/w/Cppreference:About "Cppreference:About")
  * [ Disclaimers ](/w/Cppreference:General_disclaimer "Cppreference:General disclaimer")

  * [ ![Powered by MediaWiki](/mwiki/skins/common/images/poweredby_mediawiki_88x31.png) ](//www.mediawiki.org/) [ ![Powered by GeSHi](//upload.cppreference.com/mwiki/images/2/2b/powered_by_geshi_88x31.png) ](http://qbnz.com/h