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::default_sentinel_t,std::default_sentinel(3) C++ Standard Libary std::default_sentinel_t,std::default_sentinel(3)

std::default_sentinel_t,std::default_sentinel - std::default_sentinel_t,std::default_sentinel


Defined in header <iterator>
struct default_sentinel_t { }; (1) (since C++20)
inline constexpr default_sentinel_t default_sentinel{}; (2) (since C++20)


1) default_sentinel_t is an empty class type used to denote the end of a range. It
can be used together with iterator types that know the bound of their range (e.g.,
std::counted_iterator).
2) default_sentinel is a constant of type default_sentinel_t.

// Run this code


#include <iterator>
#include <algorithm>
#include <list>
#include <iostream>


int main()
{
std::list<int> l{3,1,4,1,5,9,2,6};


std::ranges::copy(std::counted_iterator(std::begin(l), 4),
std::default_sentinel, std::ostream_iterator<int>{std::cout, " "});
}


3 1 4 1


istream_iterator input iterator that reads from std::basic_istream
(class template)
istreambuf_iterator input iterator that reads from std::basic_streambuf
(class template)
counted_iterator iterator adaptor that tracks the distance to the end of the
(C++20) range
(class template)

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.