pstade

PrevUpHomeNext

Concepts

Pipable Adaptor
Resettable Object
Stoppable Generator
Iteration Block
Constant Range
Contiguous Range
Parallel Safe
Description

A Pipable Adaptor is a Pipable Function Object which has the associated Static Function Object using prefix make_.

Refinement of
Requirements

In addition to the requirements defined in the refinements, for any Pipable Adaptor p the following must be met:

  • _typeof(p) is a POD type, and p is statically initialized.
  • x|p(x1,...,xN) is a valid expression if and only if make_++p(x, x1,...,xN) is a valid expression.
  • x|p(x1,...,xN) and make_++p(x, x1,...,xN) have the same effects.
  • make_++p is a Static Function Object.
  • If N is 0, x|p and and make_++p(x) are valid expressions which has the same effects.
Models
Description

A Resettable Object is an object which is modifiable after its construction.

Refinement of
Notation
  • r is a Resettable Object.
  • R is _typeof(r).
  • s is an object whose type is R.
  • aI is an object.
  • bI is an object whose type is _typeof(aI).
Requirements
  • R r(a0); is a valid expression if and only if s = b0; is a valid expression.
  • R r(a1,...,aN); is a valid expression if and only if s.reset(b1,...bN); is a valid expression.
  • After the two equivalent expressions above are evaluated, s and r shall have the same states if all the arguments have the same states.
  • R r; is a valid expression if and only if R s = boost::none; is a valid expression.
  • R r; is a valid expression if and only if s.reset(); is a valid expression.
  • R r; is a valid expression if and only if s = boost::none; is a valid expression.
  • After the three equivalent expressions above are evaluated, s and r shall have the same states.
Example
Models
See also
Description

A Stoppable Generator is a Polymorphic Function Object which can specify the stop of generating using Boost.Optional.

Refinement of
Requirements

In addition to the requirements defined in the refinements, for any Stoppable Generator g the following must be met:

  • _typeof(g(...)) is a boost::optional.
  • An uninitialized result is considered as the stop of generating.
Models
Description

An Iteration Block is a unary Function Object that yields an ordered sequence of values.

Refinement of
Requirements

In addition to the requirements defined in Function Object, for any Iteration Block b the following must be met:

  • For an unspecified unary Function Objecty, b(y) is a valid expression.
  • _typeof(b)::yield_type is a type of object passed to y.
Models
Description

A Constant Range is a Range whose elements are not modifiable.

Refinement of
Requirements

In addition to the requirements defined in the refinements, for any Constant Range r the following must be met:

  • boost::implicit_cast<_value_of<_typeof(r)>::type&>(*_begin(_r)) is ill-formed.
  • r is neither Writable nor Swappable.
Models
  • std::list<int> const
  • int const[10]
Description

A Contiguous Range is a Random Access Range whose elements are stored contiguously.

Refinement of
Requirements

In addition to the requirements defined in the refinements, for any Contiguous Range r the following must be met:

  • &*(_begin(r) + n) == &*(_begin(r)) + n for all n such that 0 <= n && n < _end(r) - _begin(r).
Models
  • std::vector<int>
  • boost::array<char, 50>
Description

A Parallel Safe type offers the same level of thread safety as built-in types.

Refinement of
Requirements

For any Parallel Safe type t the following must be met:

  • Different instances of t can be accessed simultaneosly by multiple threads (even when these instances are copies).
Models
  • int
  • boost::shared_ptr<int>
Copyright 2005 -2007 Shunsuke Sogame

PrevUpHomeNext