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

FreeBSD Manual Pages

  
 
  

home | help
std::weakly_incrementable(3)  C++ Standard Libary std::weakly_incrementable(3)

NAME
       std::weakly_incrementable - std::weakly_incrementable

Synopsis
	  Defined in header <iterator>
	  template<class I>

	  concept weakly_incrementable =
	  std::movable<I> &&
	  requires(I				i)			     {
       (since
	  typename				    std::iter_difference_t<I>;
       C++20)
	  requires /*is-signed-integer-like*/<std::iter_difference_t<I>>;
	  { ++i	} -> std::same_as<I&>; // not required to be equality-preserv-
       ing
	  i++; // not required to be equality-preserving

	  };

	  where	/*is-signed-integer-like*/<I> is true if and only if I is a
	  signed-integer-like type (see	below).

	  This concept specifies requirements on types that can	be incremented
       with the	pre-
	  and post-increment operators,	but those increment operations are not
       necessarily
	  equality-preserving, and the type itself is not required to be
	  std::equality_comparable.

	  For  std::weakly_incrementable types,	a == b does not	imply that ++a
       == ++b.
	  Algorithms on	weakly incrementable types must	be  single-pass	 algo-
       rithms. These
	  algorithms can be used with istreams as the source of	the input data
       through
	  std::istream_iterator.

	 Semantic requirements

	  I  models std::weakly_incrementable only if, for an object i of type
       I:

	    * The expressions ++i and i++ have the same	domain,
	    * If i is incrementable, then both ++i and i++ advance i, and
	    * If i is incrementable, then std::addressof(++i) ==  std::addres-
       sof(i).

	 Integer-like types

	  An integer-like type is an (possibly cv-qualified) integer type (ex-
       cept for	cv bool)
	  or an	implementation-provided	(not user-provided) class that behaves
       like an integer
	  type,	 including  all	 operators, implicit conversions, and std::nu-
       meric_limits
	  specializations. If an integer-like type represents  only  non-nega-
       tive values, it is
	  unsigned-integer-like, otherwise it is signed-integer-like.

	 Defect	reports

	  The following	behavior-changing defect reports were applied retroac-
       tively to
	  previously published C++ standards.

	     DR	   Applied to		 Behavior as published		  Cor-
       rect behavior
	  LWG  3467 C++20      bool was	considered as an integer-like type ex-
       cluded
	  P2325R3  C++20      default_initializable was	required	   not
       required

See also
	  incrementable	specifies that the increment operation on a weakly_in-
       crementable type
	  (C++20)	 is  equality-preserving  and  that the	type is	equal-
       ity_comparable
			(concept)

http://cppreference.com		  2022.07.31	  std::weakly_incrementable(3)

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

home | help