is_output_iterator¶
Header¶
#include <tick/traits/is_output_iterator.h>
Description¶
An output iterator is an iterator that can write to the pointed-to element.
Requirements¶
The type X
satisfies is_output_itearator
if
- The type
X
satisfies is_iterator X
is a class type or a pointer type
And, given
o
, a value of some type that is writable to the output iterator (there may be multiple types that are writable, e.g. ifoperator=
may be a template. There is no notion ofvalue_type
as for the input iterators)- r, an lvalue of type
X
,
The following expressions must be valid and have their specified effects:
Expression | Return | Equivalent expression | Pre-condition | Post-conditions | Notes |
---|---|---|---|---|---|
*r = o |
(not used) | r is dereferencable |
r is incrementable |
After this operation r is not required to be dereferenceable and any copies of the previous value of r are no longer required to be dereferenceable or incrementable. |
|
++r |
X& |
r is incrementable |
&r == &++r , r is dereferencable or past-the-end |
After this operation r is not required to be incrementable and any copies of the previous value of r are no longer required to be dereferenceable ble or incrementable. |
|
r++ |
convertible to const X& |
X temp = r; ++r; return temp; |
|||
*r++ = o |
(not used) | *r = o; ++r; |
Synopsis¶
TICK_TRAIT(is_output_iterator, is_iterator<_>)
{
template<class I, class T>
static auto require(I&& i, T&& x) -> valid<
decltype(*i = x),
decltype(*i++ = x),
decltype(returns<typename std::add_const<typename std::add_lvalue_reference<I>::type>::type>(++i))
>;
template<class I>
auto require(I&& i) -> valid<
decltype(require(std::forward<I>(i), std::declval<typename iterator_traits<I>::value_type>()))
>;
};