pstade

PrevUpHomeNext

Utilities

clone_ptr
poly
value_based
Description
Header
  • <pstade/clone_ptr.hpp>
Model of
Notation
  • ...
Valid expressions

Valid expression

Semantics

C c(p);

c owns p.

Preconditions
  • T is Clonable.
  • p is a (possibly null) pointer.
  • _typeof(p) is convertible to T *.
Invariants
  • A copy of clone_ptr<T> makes a new object by using Clonable concept.
  • A copy-assignment of clone_ptr<T> offers strong exception guarantee.
  • swap of clone_ptr<T> doesn't throw.
Example
See also
  • ...
Description
Header
  • <pstade/poly.hpp>
Model of
Valid expressions

Valid expression

Semantics

poly<T>

value_based< clone_ptr<T> >

Preconditions
  • The corresponding semantics is a valid expression.
Invariants
  • A copy-assignment of poly<T> doesn't offer strong exception guarantee.
  • swap of poly<T> doesn't offer strong exception guarantee.
Example
See also
  • ...
Description
Header
  • <pstade/value_based.hpp>
Model of
Notation
  • V is boost::pointee<P>::type.
  • v is an object whose type is V.
  • m_p is an "exposition-only" object whose type is P, which is held in value_based<P>.
Valid expressions

Valid expression

Semantics

value_based<P> x(v);

m_p(new V(v))

Preconditions
  • P is boost::shared_ptr<...> or clone_ptr<...>.
  • V is Copy Constructible.
  • The corresponding semantics is a valid expression.
Invariants
  • A copy of value_based<P> makes a copy of m_p.
  • The exception guarantee depends on P.
Example

...

See also
  • ...
Copyright © 2007 Shunsuke Sogame

PrevUpHomeNext