Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

This is the documentation for an old version of Boost. Click here to view this page for the latest version.
PrevUpHomeNext
erase_key
Description

For an associative Forward Sequence seq, returns a associative Forward Sequence containing all the elements of the original except those with a given key.

Synopsis
template<
    typename Key,
    typename Sequence
    >
typename result_of::erase_key<Sequence const, Key>::type erase_key(Sequence const& seq);

Table 1.77. Parameters

Parameter

Requirement

Description

seq

A model of Forward Sequence and Associative Sequence

Operation's argument

Key

Any type

Key to erase


Expression Semantics
erase_key<Key>(seq);

Return type: A model of Forward Sequence and Associative Sequence.

Semantics: Returns a new sequence, containing all the elements of seq, except those with key Key.

Complexity

Constant. Returns a view which is lazily evaluated.

Header
#include <boost/fusion/algorithm/transformation/erase_key.hpp>
#include <boost/fusion/include/erase_key.hpp>
Example
assert(erase_key<int>(make_map<int, long>('a', 'b')) == make_map<long>('b'));

PrevUpHomeNext