Skip site navigation (1)Skip section navigation (2)

FreeBSD Manual Pages

  
 
  

home | help
std::ranges...op_view::end(3) C++ Standard Libarystd::ranges...op_view::end(3)

NAME
       std::ranges::drop_view::end - std::ranges::drop_view::end

Synopsis
	  constexpr  auto  end()  requires  (!__SimpleView<V>);		   (1)
       (since C++20)
	  constexpr auto end()	const  requires	 ranges::range<const  V>;  (2)
       (since C++20)

	  Returns  a  sentinel	or  an	iterator  representing	the end	of the
       drop_view.

	  Effectively returns ranges::end(base_), where	base_ is the  underly-
       ing view.

Parameters
	  (none)

Return value
	  a sentinel or	an iterator representing the end of the	view

Example
       // Run this code

	#include <algorithm>
	#include <iostream>
	#include <iterator>
	#include <ranges>

	int main()
	{
	    constexpr char url[]{ "https://cppreference.com" };

	    const     auto    p	   =	std::distance(std::ranges::begin(url),
       std::ranges::find(url, '/'));
	    auto site =	std::ranges::drop_view{	url, p + 2 }; // drop the pre-
       fix "https://"

	    for	(auto it = site.begin(); it != site.end(); ++it) {
		std::cout << *it; //		    ^^^
	    }
	    std::cout << '\n';
	}

Output:
	cppreference.com

See also
	  begin		returns	an iterator to the beginning
	  (C++20)	(public	member function)
	  ranges::begin	returns	an iterator to the beginning of	a range
	  (C++20)	(customization point object)
	  ranges::end	returns	a sentinel indicating the end of a range
	  (C++20)	(customization point object)

http://cppreference.com		  2022.07.31	 std::ranges...op_view::end(3)

Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=std::ranges::drop_view::end&sektion=3&manpath=FreeBSD+Ports+15.0>

home | help