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 for the latest Boost documentation.
PrevUpHomeNext

Function template join_if

boost::algorithm::join_if — Conditional join algorithm.

Synopsis

// In header: <boost/algorithm/string/regex.hpp>


template<typename SequenceSequenceT, typename Range1T, typename CharT, 
         typename RegexTraitsT> 
  range_value< SequenceSequenceT >::type 
  join_if(const SequenceSequenceT & Input, const Range1T & Separator, 
          const basic_regex< CharT, RegexTraitsT > & Rx, 
          match_flag_type Flags = match_default);

Description

This algorithm joins all strings in a 'list' into one long string. Segments are concatenated by given separator. Only segments that match the given regular expression will be added to the result

This is a specialization of join_if algorithm.

[Note] Note

This function provides the strong exception-safety guarantee

Parameters:

Flags

Regex options

Input

A container that holds the input strings. It must be a container-of-containers.

Rx

A regular expression

Separator

A string that will separate the joined segments.

Returns:

Concatenated string.


PrevUpHomeNext