| Home | Libraries | People | FAQ | More

## Function template search

boost::compute::search — Substring matching algorithm.

## Synopsis

    // In header: <boost/compute/algorithm/search.hpp>

    template<typename TextIterator, typename PatternIterator>
      TextIterator
      search(TextIterator t_first, TextIterator t_last, PatternIterator p_first,
             PatternIterator p_last,
             command_queue & queue = system::default_queue());

## Description

Searches for the first match of the pattern [p_first, p_last) in text [t_first, t_last). Space complexity: \Omega(distance(`t_first`, `t_last`))

Parameters: |
`t_first` | Iterator pointing to start of text
`t_last` | Iterator pointing to end of text
`p_first` | Iterator pointing to start of pattern
`p_last` | Iterator pointing to end of pattern
`queue` | Queue on which to execute
Returns: | Iterator pointing to beginning of first occurrence