MCPcopy Create free account
hub / github.com/ablab/spades / starts_with

Function starts_with

ext/include/boost/algorithm/string/predicate.hpp:58–85  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56 */
57 template<typename Range1T, typename Range2T, typename PredicateT>
58 inline bool starts_with(
59 const Range1T& Input,
60 const Range2T& Test,
61 PredicateT Comp)
62 {
63 iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range1T>::type> lit_input(::boost::as_literal(Input));
64 iterator_range<BOOST_STRING_TYPENAME range_const_iterator<Range2T>::type> lit_test(::boost::as_literal(Test));
65
66 typedef BOOST_STRING_TYPENAME
67 range_const_iterator<Range1T>::type Iterator1T;
68 typedef BOOST_STRING_TYPENAME
69 range_const_iterator<Range2T>::type Iterator2T;
70
71 Iterator1T InputEnd=::boost::end(lit_input);
72 Iterator2T TestEnd=::boost::end(lit_test);
73
74 Iterator1T it=::boost::begin(lit_input);
75 Iterator2T pit=::boost::begin(lit_test);
76 for(;
77 it!=InputEnd && pit!=TestEnd;
78 ++it,++pit)
79 {
80 if( !(Comp(*it,*pit)) )
81 return false;
82 }
83
84 return pit==TestEnd;
85 }
86
87 //! 'Starts with' predicate
88 /*!

Callers 2

istarts_withFunction · 0.70
try_remove_prefixMethod · 0.50

Calls 5

as_literalFunction · 0.85
CompClass · 0.85
is_equalClass · 0.85
endClass · 0.50
beginClass · 0.50

Tested by

no test coverage detected