MCPcopy Create free account
hub / github.com/Achain-Dev/Achain / starts_with

Function starts_with

include/win/boost/algorithm/string/predicate.hpp:57–84  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers 1

istarts_withFunction · 0.70

Calls 4

is_equalClass · 0.85
as_literalFunction · 0.50
endFunction · 0.50
beginFunction · 0.50

Tested by

no test coverage detected