View Template Library


rotate_view<Iterator, Const_Iterator, Const_tag, Iter_tag>

Category: adaptors

Component type: type

Description

The rotate_view template represents a union_view of two range_views. The properties of any rotate_view instance depend on the properties of the container template parameters. [1].

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.

rotate_views are mutable if and only if the const_tag template parameter is mutable_view_tag.

A rotate_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.

Template parameters

Parameter

Description

Default

iterator

The view's iterator type


const_iterator

The view's const_iterator type.

iterator

const_tag

The view's const tag: either const_view_tag or mutable_view_tag

const_view_tag

iterator_tag

The view's directional iterator category

iterator::iterator_cateory

Definition

Defined in the header rotate_view.h.

Model of

View

Type requirements

The iterators must all be from the same container and in the following order, first, last and middle. The requirements the rotate_view satisfies depend on the requirements its template parameters satisfy:

Members

Member

Where defined

Description

value_type

Container

The type T of the elements accessed through the container.

pointer

Container

container::pointer.

reference

Container

container::reference.

const_reference

Container

container::const_reference.

size_type

Container

conainer::size_type.

difference_type

Container

container::difference_type.

iterator

Container

Iterator used to iterate through the view.

const_iterator

Container

Const iterator used to iterate through the view.

reverse_iterator

Reversible Container

Iterator used to iterate backwards through a container.

const_reverse_iterator

Reversible Container

Const iterator used to iterate backwards through a container.

iterator begin()

Container

Returns an iterator pointing to the begin of the view.

iterator end()

Container

Returns an iterator pointing to the end of the view.

const_iterator begin() const

Container

Returns a const_iterator pointing to the begin of the view.

const_iterator end() const

Container

Returns a const_iterator pointing to the end of the view.

reverse_iterator rbegin()

Reversible Container

Valid for bidirectional container's only. Returns a reverse_iterator pointing to the beginning of the reversed container.

reverse_iterator rend()

Reversible Container

Valid for bidirectional container's only. Returns a reverse_iterator pointing to the end of the reversed container.

const_reverse_iterator rbegin() const

Reversible Container

Valid for bidirectional container's only. Returns a const_reverse_iterator pointing to the beginning of the reversed container.

const_reverse_iterator rend() const

Reversible Container

Valid for bidirectional container's only. Returns a "const_reverse_iterator pointing to the end of the reversed container.

reference front()

Sequence

Returns a reference for the first element in the container.

reference back()

Sequence

Returns a reference for the last element in the container. Requires a bidirectional container.

const_reference front() const

Sequence

Returns a const_reference for the first element in the view.

const_reference back() const

Sequence

Returns a const_reference for the last element in the view. Requires a bidirectional container.

reference operator[](size_type n)

Random access container

Returns a reference for the nth element in the container.

const_reference operator[](size_type n)const

Random access container

Returns a const_reference for the nth element in the container.

reference at(size_type n)

Random access container

Returns a const_reference for the nth element in the container. Does a range check on n and will throw std::range_error if it fails.

const_reference at(size_type n)const

Random access container

Returns a const_reference for the nth element in the container. Does a range check on n and will throw std::range_error if it fails.

size_type size() const

Container

Returns the size of the view.

size_type max_size() const

Container

Returns the largest possible size of the view.

bool empty() const

Container

true if the view's size is 0.

rotate_view()

view

Creates an empty view.

rotate_view(container_iterator& first, container_iterator& last, container_iterator& middle)

view

Creates a view of given container.

void swap(rotate_view&)

Container

Swaps the two views. Iterators are invalidated by this operation. For referencing views, the containers themselves are not swapped.

bool operator==(const rotate_view&, const rotate_view&)

Forward Container

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.

bool operator<(const rotate_view&, const rotate_view&)

Forward Container

Lexicographical comparison. This is a global function, not a member function.

Notes

[1]


VTL Home
Copyright © 1999 Konrad-Zuse-Zentrum für Informationstechnik Berlin & Gary Powell All Rights Reserved.