View Template Library


map_keys_filtered<Container, Pred, Const_tag, Iter_tag, Base>

Category: adaptors

Component type: type

Description

The map_keys_filtered is a filter_view of a map_keys view.

The map_keys_filtered presents only those elements from map_keys for which the predicate is true are returned.

The properties of the order of elements are the same as those provided by the underlying container, as is the validity of more than one active iterators at any one time.

map_keys_filteredviews are mutable if and only if the const_tag template parameter is mutable_view_tag. Note that changing elements of the container may result in invalidated iterators and may change the size of the view. Thus, use mutable views only if you really know what you are doing.

A map_keys_filtered owns its referenced container, if its base template parameter is aggregated_ownership, it merely references its container, if the base template parameter is referenced_ownership.

Template parameters

Parameter

Description

Default

container

The view's container type: a Pair Associative Container


predicate

The view's predicate type: the type of the predicate used to filter the container's elements


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

Container::iterator::category or bidirectional_iterator_tag whichever is the lesser.

base

The view's ownership type: the base class that determines if the view references or owns the container

referenced_ownership

Definition

Defined in the header map_view.hpp.

Model of

View

Type requirements

T has to be assignable. predicate has to be a predicate with argument type container::value_type. predicate's operator() has to be a const member. The requirements the map_keys_filtered satisfies depend on the requirements its template parameters satisfy:

Container satisfies

View satisfies

Container

Container [1]

Forward Container

Forward Container [1]

Pair Associative Container


Members

Member

Where defined

Description

value_type

Container

The type T of the elements accessed through the container.

domain_type

view

The type of the referenced container.

predicate_t

view

The type of the filtering predicate.

pointer

Container

Pointer to T.

reference

Container

Reference to T.

const_reference

Container

Const reference to T.

size_type

Container

An unsigned integral type.

difference_type

Container

A signed integral 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 reversible container's only. Returns a reverse_iterator pointing to the beginning of the reversed container.

reverse_iterator rend()

Reversible Container

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

const_reverse_iterator rbegin() const

Reversible Container

Valid for reversible 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 reversible container's only. Returns a const_reverse_iterator pointing to the end of the reversed container.

size_type size() const

Container

Returns the size of the view. [1]

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.

map_keys_filtered()

view

Creates an empty view.

map_keys_filtered(container_t&, const predicate_t&)

view

Creates a view of given container.

void swap(map_keys_filtered&)

Container

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

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

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 map_keys_filtered&, const map_keys_filtered&)

Forward Container

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

Notes

[1] A map_keys_filtered satisfies all the requirements of container, except for size() and iterator increment/decrement not guaranteeing constant complexity.



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