GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
std::basic_string_view::max_size(3) C++ Standard Libary std::basic_string_view::max_size(3)

std::basic_string_view::max_size - std::basic_string_view::max_size


constexpr size_type max_size() const noexcept; (since C++17)


The largest possible number of char-like objects that can be referred to by a
basic_string_view.


(none)


Maximum number of characters.


Constant.

// Run this code


#include <iostream>
#include <limits>
#include <string_view>


int main() {
std::cout
<< std::numeric_limits<std::int64_t>::max()
<< " <- numeric_limits<int64_t>::max()\n"
<< std::string_view{}.max_size()
<< " <- std::string_view::max_size()\n"
<< std::basic_string_view<char>{}.max_size()
<< " <- std::basic_string_view<char>::max_size()\n"
<< std::basic_string_view<char16_t>{}.max_size()
<< " <- std::basic_string_view<char16_t>::max_size()\n"
<< std::wstring_view{}.max_size()
<< " <- std::wstring_view::max_size()\n"
<< std::basic_string_view<char32_t>{}.max_size()
<< " <- std::basic_string_view<char32_t>::max_size()\n"
;
}


9223372036854775807 <- numeric_limits<int64_t>::max()
4611686018427387899 <- std::string_view::max_size()
4611686018427387899 <- std::basic_string_view<char>::max_size()
2305843009213693949 <- std::basic_string_view<char16_t>::max_size()
1152921504606846974 <- std::wstring_view::max_size()
1152921504606846974 <- std::basic_string_view<char32_t>::max_size()


size returns the number of characters
length (public member function)
(C++17)
empty checks whether the view is empty
(C++17) (public member function)
max_size returns the maximum number of characters
(public member function of std::basic_string<CharT,Traits,Allocator>)

2022.07.31 http://cppreference.com

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.