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

Function starts_with

boost::algorithm::starts_with — 'Starts with' predicate

Synopsis

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


template<typename Range1T, typename Range2T, typename PredicateT> 
  bool starts_with(const Range1T & Input, const Range2T & Test, 
                   PredicateT Comp);
template<typename Range1T, typename Range2T> 
  bool starts_with(const Range1T & Input, const Range2T & Test);

Description

This predicate holds when the test string is a prefix of the Input. In other words, if the input starts with the test. When the optional predicate is specified, it is used for character-wise comparison.

[Note] Note

This function provides the strong exception-safety guarantee

Parameters:

Comp

An element comparison predicate

Input

An input sequence

Test

A test sequence

Returns:

The result of the test


PrevUpHomeNext