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
join
Description

Takes 2 sequences and returns a sequence containing the elements of the first followed by the elements of the second.

Synopsis
template<
    typename LhSequence,
    typename RhSequence>
typename result_of::join<LhSequence, RhSequence>::type join(LhSequence const& lhs, RhSequence const& rhs);

Table 1.67. Parameters

Parameter

Requirement

Description

lhs

A model of Forward Sequence

Operation's argument

rhs

A model of Forward Sequence

Operation's argument

Expression Semantics
join(lhs, rhs);

Return type: A model of Forward Sequence.

Semantics: Returns a sequence containing all the elements of lhs followed by all the elements of rhs. The order of th elements is preserved.

Complexity

Constant. Returns a view which is lazily evaluated.

Header
#include <boost/fusion/algorithm/transformation/join.hpp>
#include <boost/fusion/include/join.hpp>
Example
vector<int,char> v1(1, 'a');
vector<int,char> v2(2, 'b');
assert(join(v1, v2) == make_vector(1,'a',2,'b'));

PrevUpHomeNext