Category: adaptors |
Component type: type |
The union_view
template represents objects that
reference two containers, and that have methods for accessing their
elements. The properties of any union_view
instance
depend on the properties of the container template
parameters. More accurately, a union_view
referencing
Container provides a Container
interface, a union_view
referencing Forward
Containers provides a Forward Container interface while a Random
Access Container provides a Random Access Conatiner
interface.[1].
The union_view
presents all the elements of both
containers concatenated.
The guarantees of the order of elements are the same as those provided by both underlying container, as is the validity of more than one active iterators at any one time.
union_views
are mutable if and only if the const_tag
template parameter is mutable_view_tag
.
A union_view
owns its referenced containers, if its
corresponding base template parameter is aggregated_ownership
,
it merely references its containers, if the base template
parameter is referenced_ownership.
WARNING: Do not confuse the view type with the view concept!
Parameter |
Description |
Default |
container_a |
The view's container A type: the type of container referenced by this view |
|
|
The view's container B type: the type of container referenced by this view |
|
|
The view's const tag: either |
|
|
The view's directional iterator category |
The minium of |
base_a |
The view's ownership type: the base class that determines if the view references or owns the container |
referenced_ownership |
base_b |
The view's ownership type: the base class that determines if the view references or owns the container |
referenced_ownership |
Defined in the header union_view.h
.
The two containers have to have the
same value type. The requirements the union_view
satisfies depend on the requirements its template parameters satisfy:
Container satisfies |
View satisfies |
Member |
Where defined |
Description |
|
The type T of the elements accessed through the container. |
|
|
The type of the referenced container A. |
|
|
The type of the referenced container B. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Iterator used to iterate through the view. |
|
|
Const iterator used to iterate through the view. |
|
|
Iterator used to iterate backwards through a container. |
|
|
Const iterator used to iterate backwards through a container. |
|
|
Returns an iterator pointing to the begin of the view. |
|
|
Returns an iterator pointing to the end of the view. |
|
|
Returns a const_iterator pointing to the begin of the view. |
|
|
Returns a const_iterator pointing to the end of the view. |
|
|
Valid for bidirectional container's only. Returns a reverse_iterator pointing to the beginning of the reversed container. |
|
|
Valid for bidirectional container's only. Returns a reverse_iterator pointing to the end of the reversed container. |
|
|
Valid for
bidirectional container's only. Returns a |
|
|
Valid for bidirectional container's only. Returns a
|
|
|
Returns a |
|
|
Returns a |
|
|
Returns a |
|
|
Returns a |
|
|
Returns a |
|
|
Returns a |
|
|
Returns a |
|
|
Returns a |
|
|
Returns the size of the view. |
|
|
Returns the largest possible size of the view. |
|
|
true if the view's size is 0. |
|
|
Creates an empty view. |
|
|
Creates a view of given container. |
|
|
Swaps the two views. Iterators are invalidated by this operation. For referencing views, the containers themselves are not swapped. |
|
|
Tests two views for equality. This is a global function, not a member function. Views may be equal even if their referenced containers are not. |
|
|
Lexicographical comparison. This is a global function, not a member function. |
VTL Home
Copyright
© 1999 Konrad-Zuse-Zentrum für Informationstechnik Berlin &
Gary Powell All Rights Reserved.