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

FreeBSD Manual Pages

  
 
  

home | help
std::experi...zedSentinel(3)  C++ Standard Libary std::experi...zedSentinel(3)

NAME
       std::experimental::ranges::SizedSentinel	       -       std::experimen-
       tal::ranges::SizedSentinel

Synopsis
	  Defined in header <experimental/ranges/iterator>
	  template <class S, class I>

	  concept bool SizedSentinel =
	  Sentinel<S, I> &&
	  !ranges::disable_sized_sentinel<std::remove_cv_t<S>,
	  std::remove_cv_t<I>>						    &&
       (1) (ranges TS)
	  requires(const I& i, const S&	s) {
	  { s -	i } -> Same<ranges::difference_type_t<I>>&&;
	  { i -	s } -> Same<ranges::difference_type_t<I>>&&;

	  };
	  template	      <class	       S,	    class	    I>
       (1) (ranges TS)
	  constexpr bool disable_sized_sentinel	= false;

	  The SizedSentinel concept specifies that an object of	 the  iterator
       type I and an
	  object  of the sentinel type S can be	subtracted to compute the dis-
       tance between them
	  in constant time.

	  Let i	be an iterator of type I, and s	a sentinel of type S such that
       [i, s) denotes
	  a range. Let N be the	smallest number	of applications	of ++i	neces-
       sary to make
	  bool(i == s) be true.	Then SizedSentinel<S, I> is satisfied only if:

	    *  If N is representable by	ranges::difference_type_t<I>, then s -
       i is
	      well-defined and equals N; and
	    * If -N is representable by	ranges::difference_type_t<I>, then i -
       s is
	      well-defined and equals -N.

	  The variable template	disable_sized_sentinel	provides  a  mechanism
       for iterators and
	  sentinels  that  can	be subtracted but do not meet the semantic re-
       quirements of
	  SizedSentinel	to opt out of the concept by specializing the variable
       template	to
	  have the value true.

	 Equality preservation

	  An expression	is equality preserving if it results in	equal  outputs
       given equal
	  inputs.

	    * The inputs to an expression consist of its operands.
	    *  The  outputs  of	 an  expression	 consist of its	result and all
       operands	modified by
	      the expression (if any).

	  Every	expression required to be equality preserving is  further  re-
       quired to be
	  stable:  two	evaluations  of	such an	expression with	the same input
       objects must have
	  equal	outputs	absent any explicit intervening	modification of	 those
       input objects.

	  Unless  noted	otherwise, every expression used in a requires-expres-
       sion is required
	  to be	equality preserving and	stable,	and the	evaluation of the  ex-
       pression	may only
	  modify  its  non-constant  operands. Operands	that are constant must
       not be modified.

	 Implicit expression variations

	  A requires-expression	that uses an expression	that is	 non-modifying
       for some
	  constant  lvalue  operand also implicitly requires additional	varia-
       tions of	that
	  expression that accept a non-constant	lvalue or (possibly  constant)
       rvalue for the
	  given	 operand unless	such an	expression variation is	explicitly re-
       quired with
	  differing semantics. These implicit expression variations must  meet
       the same
	  semantic  requirements  of  the  declared  expression. The extent to
       which an
	  implementation validates the syntax of the  variations  is  unspeci-
       fied.

http://cppreference.com		  2022.07.31	  std::experi...zedSentinel(3)

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

home | help