mirror of
https://github.com/boostorg/algorithm.git
synced 2025-07-06 09:16:33 +02:00
negative indexes support added to *_nth, *_head and *_tail algorithms
[SVN r32475]
This commit is contained in:
@ -90,7 +90,7 @@ namespace boost {
|
|||||||
|
|
||||||
// find last functor -----------------------------------------------//
|
// find last functor -----------------------------------------------//
|
||||||
|
|
||||||
// find the last match a subsequnce in the sequence ( functor )
|
// find the last match a subseqeunce in the sequence ( functor )
|
||||||
/*
|
/*
|
||||||
Returns a pair <begin,end> marking the subsequence in the sequence.
|
Returns a pair <begin,end> marking the subsequence in the sequence.
|
||||||
If the find fails, returns <End,End>
|
If the find fails, returns <End,End>
|
||||||
@ -200,7 +200,7 @@ namespace boost {
|
|||||||
|
|
||||||
// find n-th functor -----------------------------------------------//
|
// find n-th functor -----------------------------------------------//
|
||||||
|
|
||||||
// find the n-th match of a subsequnce in the sequence ( functor )
|
// find the n-th match of a subsequence in the sequence ( functor )
|
||||||
/*
|
/*
|
||||||
Returns a pair <begin,end> marking the subsequence in the sequence.
|
Returns a pair <begin,end> marking the subsequence in the sequence.
|
||||||
If the find fails, returns <End,End>
|
If the find fails, returns <End,End>
|
||||||
@ -212,12 +212,15 @@ namespace boost {
|
|||||||
typedef first_finderF<
|
typedef first_finderF<
|
||||||
search_iterator_type,
|
search_iterator_type,
|
||||||
PredicateT> first_finder_type;
|
PredicateT> first_finder_type;
|
||||||
|
typedef last_finderF<
|
||||||
|
search_iterator_type,
|
||||||
|
PredicateT> last_finder_type;
|
||||||
|
|
||||||
// Construction
|
// Construction
|
||||||
template< typename SearchT >
|
template< typename SearchT >
|
||||||
nth_finderF(
|
nth_finderF(
|
||||||
const SearchT& Search,
|
const SearchT& Search,
|
||||||
unsigned int Nth,
|
int Nth,
|
||||||
PredicateT Comp) :
|
PredicateT Comp) :
|
||||||
m_Search(begin(Search), end(Search)),
|
m_Search(begin(Search), end(Search)),
|
||||||
m_Nth(Nth),
|
m_Nth(Nth),
|
||||||
@ -225,7 +228,7 @@ namespace boost {
|
|||||||
nth_finderF(
|
nth_finderF(
|
||||||
search_iterator_type SearchBegin,
|
search_iterator_type SearchBegin,
|
||||||
search_iterator_type SearchEnd,
|
search_iterator_type SearchEnd,
|
||||||
unsigned int Nth,
|
int Nth,
|
||||||
PredicateT Comp) :
|
PredicateT Comp) :
|
||||||
m_Search(SearchBegin, SearchEnd),
|
m_Search(SearchBegin, SearchEnd),
|
||||||
m_Nth(Nth),
|
m_Nth(Nth),
|
||||||
@ -237,6 +240,26 @@ namespace boost {
|
|||||||
operator()(
|
operator()(
|
||||||
ForwardIteratorT Begin,
|
ForwardIteratorT Begin,
|
||||||
ForwardIteratorT End ) const
|
ForwardIteratorT End ) const
|
||||||
|
{
|
||||||
|
if(m_Nth>=0)
|
||||||
|
{
|
||||||
|
return find_forward(Begin, End, m_Nth);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return find_backward(Begin, End, -m_Nth);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private:
|
||||||
|
// Implementation helpers
|
||||||
|
template< typename ForwardIteratorT >
|
||||||
|
iterator_range<ForwardIteratorT>
|
||||||
|
find_forward(
|
||||||
|
ForwardIteratorT Begin,
|
||||||
|
ForwardIteratorT End,
|
||||||
|
unsigned int N) const
|
||||||
{
|
{
|
||||||
typedef ForwardIteratorT input_iterator_type;
|
typedef ForwardIteratorT input_iterator_type;
|
||||||
typedef iterator_range<ForwardIteratorT> result_type;
|
typedef iterator_range<ForwardIteratorT> result_type;
|
||||||
@ -245,13 +268,13 @@ namespace boost {
|
|||||||
if( boost::empty(m_Search) )
|
if( boost::empty(m_Search) )
|
||||||
return result_type( End, End );
|
return result_type( End, End );
|
||||||
|
|
||||||
// Instantiate find funtor
|
// Instantiate find functor
|
||||||
first_finder_type first_finder(
|
first_finder_type first_finder(
|
||||||
m_Search.begin(), m_Search.end(), m_Comp );
|
m_Search.begin(), m_Search.end(), m_Comp );
|
||||||
|
|
||||||
result_type M( Begin, Begin );
|
result_type M( Begin, Begin );
|
||||||
|
|
||||||
for( unsigned int n=0; n<=m_Nth; ++n )
|
for( unsigned int n=0; n<=N; ++n )
|
||||||
{
|
{
|
||||||
// find next match
|
// find next match
|
||||||
M=first_finder( end(M), End );
|
M=first_finder( end(M), End );
|
||||||
@ -266,14 +289,101 @@ namespace boost {
|
|||||||
return M;
|
return M;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template< typename ForwardIteratorT >
|
||||||
|
iterator_range<ForwardIteratorT>
|
||||||
|
find_backward(
|
||||||
|
ForwardIteratorT Begin,
|
||||||
|
ForwardIteratorT End,
|
||||||
|
unsigned int N) const
|
||||||
|
{
|
||||||
|
typedef ForwardIteratorT input_iterator_type;
|
||||||
|
typedef iterator_range<ForwardIteratorT> result_type;
|
||||||
|
|
||||||
|
// Sanity check
|
||||||
|
if( boost::empty(m_Search) )
|
||||||
|
return result_type( End, End );
|
||||||
|
|
||||||
|
// Instantiate find functor
|
||||||
|
last_finder_type last_finder(
|
||||||
|
m_Search.begin(), m_Search.end(), m_Comp );
|
||||||
|
|
||||||
|
result_type M( End, End );
|
||||||
|
|
||||||
|
for( unsigned int n=1; n<=N; ++n )
|
||||||
|
{
|
||||||
|
// find next match
|
||||||
|
M=last_finder( Begin, begin(M) );
|
||||||
|
|
||||||
|
if ( !M )
|
||||||
|
{
|
||||||
|
// Subsequence not found, return
|
||||||
|
return M;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return M;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
iterator_range<search_iterator_type> m_Search;
|
iterator_range<search_iterator_type> m_Search;
|
||||||
unsigned int m_Nth;
|
int m_Nth;
|
||||||
PredicateT m_Comp;
|
PredicateT m_Comp;
|
||||||
};
|
};
|
||||||
|
|
||||||
// find head functor -----------------------------------------------//
|
// find head functor -----------------------------------------------//
|
||||||
|
|
||||||
|
// Find head implementation
|
||||||
|
template<typename ForwardIteratorT>
|
||||||
|
iterator_range<ForwardIteratorT>
|
||||||
|
find_head_impl(
|
||||||
|
ForwardIteratorT Begin,
|
||||||
|
ForwardIteratorT End,
|
||||||
|
unsigned int N )
|
||||||
|
{
|
||||||
|
typedef BOOST_STRING_TYPENAME boost::detail::
|
||||||
|
iterator_traits<ForwardIteratorT>::iterator_category category;
|
||||||
|
|
||||||
|
return find_head_impl( Begin, End, N, category() );
|
||||||
|
}
|
||||||
|
|
||||||
|
template<typename ForwardIteratorT>
|
||||||
|
iterator_range<ForwardIteratorT>
|
||||||
|
find_head_impl(
|
||||||
|
ForwardIteratorT Begin,
|
||||||
|
ForwardIteratorT End,
|
||||||
|
unsigned int N,
|
||||||
|
std::forward_iterator_tag )
|
||||||
|
{
|
||||||
|
typedef ForwardIteratorT input_iterator_type;
|
||||||
|
typedef iterator_range<ForwardIteratorT> result_type;
|
||||||
|
|
||||||
|
input_iterator_type It=Begin;
|
||||||
|
for(
|
||||||
|
unsigned int Index=0;
|
||||||
|
Index<N && It!=End; ++Index,++It ) {};
|
||||||
|
|
||||||
|
return result_type( Begin, It );
|
||||||
|
}
|
||||||
|
|
||||||
|
template< typename ForwardIteratorT >
|
||||||
|
iterator_range<ForwardIteratorT>
|
||||||
|
find_head_impl(
|
||||||
|
ForwardIteratorT Begin,
|
||||||
|
ForwardIteratorT End,
|
||||||
|
unsigned int N,
|
||||||
|
std::random_access_iterator_tag )
|
||||||
|
{
|
||||||
|
typedef ForwardIteratorT input_iterator_type;
|
||||||
|
typedef iterator_range<ForwardIteratorT> result_type;
|
||||||
|
|
||||||
|
if ( (End<=Begin) || ( static_cast<unsigned int>(End-Begin) < N ) )
|
||||||
|
return result_type( Begin, End );
|
||||||
|
|
||||||
|
return result_type(Begin,Begin+N);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// find a head in the sequence ( functor )
|
// find a head in the sequence ( functor )
|
||||||
/*
|
/*
|
||||||
This functor find a head of the specified range. For
|
This functor find a head of the specified range. For
|
||||||
@ -283,7 +393,7 @@ namespace boost {
|
|||||||
struct head_finderF
|
struct head_finderF
|
||||||
{
|
{
|
||||||
// Construction
|
// Construction
|
||||||
head_finderF( unsigned int N ) : m_N(N) {}
|
head_finderF( int N ) : m_N(N) {}
|
||||||
|
|
||||||
// Operation
|
// Operation
|
||||||
template< typename ForwardIteratorT >
|
template< typename ForwardIteratorT >
|
||||||
@ -292,54 +402,99 @@ namespace boost {
|
|||||||
ForwardIteratorT Begin,
|
ForwardIteratorT Begin,
|
||||||
ForwardIteratorT End ) const
|
ForwardIteratorT End ) const
|
||||||
{
|
{
|
||||||
typedef BOOST_STRING_TYPENAME boost::detail::
|
if(m_N>=0)
|
||||||
iterator_traits<ForwardIteratorT>::iterator_category category;
|
{
|
||||||
|
return find_head_impl( Begin, End, m_N );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
iterator_range<ForwardIteratorT> Res=
|
||||||
|
find_tail_impl( Begin, End, -m_N );
|
||||||
|
|
||||||
return findit( Begin, End, category() );
|
return make_iterator_range(Begin, Res.begin());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Find operation implementation
|
int m_N;
|
||||||
template< typename ForwardIteratorT >
|
|
||||||
iterator_range<ForwardIteratorT>
|
|
||||||
findit(
|
|
||||||
ForwardIteratorT Begin,
|
|
||||||
ForwardIteratorT End,
|
|
||||||
std::forward_iterator_tag ) const
|
|
||||||
{
|
|
||||||
typedef ForwardIteratorT input_iterator_type;
|
|
||||||
typedef iterator_range<ForwardIteratorT> result_type;
|
|
||||||
|
|
||||||
input_iterator_type It=Begin;
|
|
||||||
for(
|
|
||||||
unsigned int Index=0;
|
|
||||||
Index<m_N && It!=End; ++Index,++It ) {};
|
|
||||||
|
|
||||||
return result_type( Begin, It );
|
|
||||||
}
|
|
||||||
|
|
||||||
template< typename ForwardIteratorT >
|
|
||||||
iterator_range<ForwardIteratorT>
|
|
||||||
findit(
|
|
||||||
ForwardIteratorT Begin,
|
|
||||||
ForwardIteratorT End,
|
|
||||||
std::random_access_iterator_tag ) const
|
|
||||||
{
|
|
||||||
typedef ForwardIteratorT input_iterator_type;
|
|
||||||
typedef iterator_range<ForwardIteratorT> result_type;
|
|
||||||
|
|
||||||
if ( (End<=Begin) || ( static_cast<unsigned int>(End-Begin) < m_N ) )
|
|
||||||
return result_type( Begin, End );
|
|
||||||
|
|
||||||
return result_type(Begin,Begin+m_N);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
unsigned int m_N;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// find tail functor -----------------------------------------------//
|
// find tail functor -----------------------------------------------//
|
||||||
|
|
||||||
|
// Operation
|
||||||
|
template< typename ForwardIteratorT >
|
||||||
|
iterator_range<ForwardIteratorT>
|
||||||
|
find_tail_impl(
|
||||||
|
ForwardIteratorT Begin,
|
||||||
|
ForwardIteratorT End,
|
||||||
|
unsigned int N )
|
||||||
|
{
|
||||||
|
typedef BOOST_STRING_TYPENAME boost::detail::
|
||||||
|
iterator_traits<ForwardIteratorT>::iterator_category category;
|
||||||
|
|
||||||
|
return find_tail_impl( Begin, End, N, category() );
|
||||||
|
}
|
||||||
|
|
||||||
|
template< typename ForwardIteratorT >
|
||||||
|
iterator_range<ForwardIteratorT>
|
||||||
|
find_tail_impl(
|
||||||
|
ForwardIteratorT Begin,
|
||||||
|
ForwardIteratorT End,
|
||||||
|
unsigned int N,
|
||||||
|
std::forward_iterator_tag )
|
||||||
|
{
|
||||||
|
typedef ForwardIteratorT input_iterator_type;
|
||||||
|
typedef iterator_range<ForwardIteratorT> result_type;
|
||||||
|
|
||||||
|
unsigned int Index=0;
|
||||||
|
input_iterator_type It=Begin;
|
||||||
|
input_iterator_type It2=Begin;
|
||||||
|
|
||||||
|
// Advance It2 by N increments
|
||||||
|
for( Index=0; Index<N && It2!=End; ++Index,++It2 ) {};
|
||||||
|
|
||||||
|
// Advance It, It2 to the end
|
||||||
|
for(; It2!=End; ++It,++It2 ) {};
|
||||||
|
|
||||||
|
return result_type( It, It2 );
|
||||||
|
}
|
||||||
|
|
||||||
|
template< typename ForwardIteratorT >
|
||||||
|
iterator_range<ForwardIteratorT>
|
||||||
|
find_tail_impl(
|
||||||
|
ForwardIteratorT Begin,
|
||||||
|
ForwardIteratorT End,
|
||||||
|
unsigned int N,
|
||||||
|
std::bidirectional_iterator_tag )
|
||||||
|
{
|
||||||
|
typedef ForwardIteratorT input_iterator_type;
|
||||||
|
typedef iterator_range<ForwardIteratorT> result_type;
|
||||||
|
|
||||||
|
input_iterator_type It=End;
|
||||||
|
for(
|
||||||
|
unsigned int Index=0;
|
||||||
|
Index<N && It!=Begin; ++Index,--It ) {};
|
||||||
|
|
||||||
|
return result_type( It, End );
|
||||||
|
}
|
||||||
|
|
||||||
|
template< typename ForwardIteratorT >
|
||||||
|
iterator_range<ForwardIteratorT>
|
||||||
|
find_tail_impl(
|
||||||
|
ForwardIteratorT Begin,
|
||||||
|
ForwardIteratorT End,
|
||||||
|
unsigned int N,
|
||||||
|
std::random_access_iterator_tag )
|
||||||
|
{
|
||||||
|
typedef ForwardIteratorT input_iterator_type;
|
||||||
|
typedef iterator_range<ForwardIteratorT> result_type;
|
||||||
|
|
||||||
|
if ( (End<=Begin) || ( static_cast<unsigned int>(End-Begin) < N ) )
|
||||||
|
return result_type( Begin, End );
|
||||||
|
|
||||||
|
return result_type( End-N, End );
|
||||||
|
}
|
||||||
|
|
||||||
// find a tail in the sequence ( functor )
|
// find a tail in the sequence ( functor )
|
||||||
/*
|
/*
|
||||||
This functor find a tail of the specified range. For
|
This functor find a tail of the specified range. For
|
||||||
@ -349,7 +504,7 @@ namespace boost {
|
|||||||
struct tail_finderF
|
struct tail_finderF
|
||||||
{
|
{
|
||||||
// Construction
|
// Construction
|
||||||
tail_finderF( unsigned int N ) : m_N(N) {}
|
tail_finderF( int N ) : m_N(N) {}
|
||||||
|
|
||||||
// Operation
|
// Operation
|
||||||
template< typename ForwardIteratorT >
|
template< typename ForwardIteratorT >
|
||||||
@ -358,74 +513,21 @@ namespace boost {
|
|||||||
ForwardIteratorT Begin,
|
ForwardIteratorT Begin,
|
||||||
ForwardIteratorT End ) const
|
ForwardIteratorT End ) const
|
||||||
{
|
{
|
||||||
typedef BOOST_STRING_TYPENAME boost::detail::
|
if(m_N>=0)
|
||||||
iterator_traits<ForwardIteratorT>::iterator_category category;
|
{
|
||||||
|
return find_tail_impl( Begin, End, m_N );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
iterator_range<ForwardIteratorT> Res=
|
||||||
|
find_head_impl( Begin, End, -m_N );
|
||||||
|
|
||||||
return findit( Begin, End, category() );
|
return make_iterator_range(Res.end(), End);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
// Find operation implementation
|
int m_N;
|
||||||
template< typename ForwardIteratorT >
|
|
||||||
iterator_range<ForwardIteratorT>
|
|
||||||
findit(
|
|
||||||
ForwardIteratorT Begin,
|
|
||||||
ForwardIteratorT End,
|
|
||||||
std::forward_iterator_tag ) const
|
|
||||||
{
|
|
||||||
typedef ForwardIteratorT input_iterator_type;
|
|
||||||
typedef iterator_range<ForwardIteratorT> result_type;
|
|
||||||
|
|
||||||
unsigned int Index=0;
|
|
||||||
input_iterator_type It=Begin;
|
|
||||||
input_iterator_type It2=Begin;
|
|
||||||
|
|
||||||
// Advance It2 by N incremets
|
|
||||||
for( Index=0; Index<m_N && It2!=End; ++Index,++It2 ) {};
|
|
||||||
|
|
||||||
// Advance It, It2 to the end
|
|
||||||
for(; It2!=End; ++It,++It2 ) {};
|
|
||||||
|
|
||||||
return result_type( It, It2 );
|
|
||||||
}
|
|
||||||
|
|
||||||
template< typename ForwardIteratorT >
|
|
||||||
iterator_range<ForwardIteratorT>
|
|
||||||
findit(
|
|
||||||
ForwardIteratorT Begin,
|
|
||||||
ForwardIteratorT End,
|
|
||||||
std::bidirectional_iterator_tag ) const
|
|
||||||
{
|
|
||||||
typedef ForwardIteratorT input_iterator_type;
|
|
||||||
typedef iterator_range<ForwardIteratorT> result_type;
|
|
||||||
|
|
||||||
input_iterator_type It=End;
|
|
||||||
for(
|
|
||||||
unsigned int Index=0;
|
|
||||||
Index<m_N && It!=Begin; ++Index,--It ) {};
|
|
||||||
|
|
||||||
return result_type( It, End );
|
|
||||||
}
|
|
||||||
|
|
||||||
template< typename ForwardIteratorT >
|
|
||||||
iterator_range<ForwardIteratorT>
|
|
||||||
findit(
|
|
||||||
ForwardIteratorT Begin,
|
|
||||||
ForwardIteratorT End,
|
|
||||||
std::random_access_iterator_tag ) const
|
|
||||||
{
|
|
||||||
typedef ForwardIteratorT input_iterator_type;
|
|
||||||
typedef iterator_range<ForwardIteratorT> result_type;
|
|
||||||
|
|
||||||
if ( (End<=Begin) || ( static_cast<unsigned int>(End-Begin) < m_N ) )
|
|
||||||
return result_type( Begin, End );
|
|
||||||
|
|
||||||
return result_type( End-m_N, End );
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
unsigned int m_N;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// find token functor -----------------------------------------------//
|
// find token functor -----------------------------------------------//
|
||||||
@ -475,7 +577,7 @@ namespace boost {
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Advance by one possition
|
// Advance by one position
|
||||||
++It2;
|
++It2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -400,7 +400,7 @@ namespace boost {
|
|||||||
OutputIteratorT Output,
|
OutputIteratorT Output,
|
||||||
const Range1T& Input,
|
const Range1T& Input,
|
||||||
const Range2T& Search,
|
const Range2T& Search,
|
||||||
unsigned int Nth )
|
int Nth )
|
||||||
{
|
{
|
||||||
return find_format_copy(
|
return find_format_copy(
|
||||||
Output,
|
Output,
|
||||||
@ -417,7 +417,7 @@ namespace boost {
|
|||||||
inline SequenceT erase_nth_copy(
|
inline SequenceT erase_nth_copy(
|
||||||
const SequenceT& Input,
|
const SequenceT& Input,
|
||||||
const RangeT& Search,
|
const RangeT& Search,
|
||||||
unsigned int Nth )
|
int Nth )
|
||||||
{
|
{
|
||||||
return find_format_copy(
|
return find_format_copy(
|
||||||
Input,
|
Input,
|
||||||
@ -438,7 +438,7 @@ namespace boost {
|
|||||||
inline void erase_nth(
|
inline void erase_nth(
|
||||||
SequenceT& Input,
|
SequenceT& Input,
|
||||||
const RangeT& Search,
|
const RangeT& Search,
|
||||||
unsigned int Nth )
|
int Nth )
|
||||||
{
|
{
|
||||||
find_format(
|
find_format(
|
||||||
Input,
|
Input,
|
||||||
@ -473,7 +473,7 @@ namespace boost {
|
|||||||
OutputIteratorT Output,
|
OutputIteratorT Output,
|
||||||
const Range1T& Input,
|
const Range1T& Input,
|
||||||
const Range2T& Search,
|
const Range2T& Search,
|
||||||
unsigned int Nth,
|
int Nth,
|
||||||
const std::locale& Loc=std::locale() )
|
const std::locale& Loc=std::locale() )
|
||||||
{
|
{
|
||||||
return find_format_copy(
|
return find_format_copy(
|
||||||
@ -491,7 +491,7 @@ namespace boost {
|
|||||||
inline SequenceT ierase_nth_copy(
|
inline SequenceT ierase_nth_copy(
|
||||||
const SequenceT& Input,
|
const SequenceT& Input,
|
||||||
const RangeT& Search,
|
const RangeT& Search,
|
||||||
unsigned int Nth,
|
int Nth,
|
||||||
const std::locale& Loc=std::locale() )
|
const std::locale& Loc=std::locale() )
|
||||||
{
|
{
|
||||||
return find_format_copy(
|
return find_format_copy(
|
||||||
@ -514,7 +514,7 @@ namespace boost {
|
|||||||
inline void ierase_nth(
|
inline void ierase_nth(
|
||||||
SequenceT& Input,
|
SequenceT& Input,
|
||||||
const RangeT& Search,
|
const RangeT& Search,
|
||||||
unsigned int Nth,
|
int Nth,
|
||||||
const std::locale& Loc=std::locale() )
|
const std::locale& Loc=std::locale() )
|
||||||
{
|
{
|
||||||
find_format(
|
find_format(
|
||||||
@ -687,7 +687,7 @@ namespace boost {
|
|||||||
inline OutputIteratorT erase_head_copy(
|
inline OutputIteratorT erase_head_copy(
|
||||||
OutputIteratorT Output,
|
OutputIteratorT Output,
|
||||||
const RangeT& Input,
|
const RangeT& Input,
|
||||||
unsigned int N )
|
int N )
|
||||||
{
|
{
|
||||||
return find_format_copy(
|
return find_format_copy(
|
||||||
Output,
|
Output,
|
||||||
@ -703,7 +703,7 @@ namespace boost {
|
|||||||
template<typename SequenceT>
|
template<typename SequenceT>
|
||||||
inline SequenceT erase_head_copy(
|
inline SequenceT erase_head_copy(
|
||||||
const SequenceT& Input,
|
const SequenceT& Input,
|
||||||
unsigned int N )
|
int N )
|
||||||
{
|
{
|
||||||
return find_format_copy(
|
return find_format_copy(
|
||||||
Input,
|
Input,
|
||||||
@ -723,7 +723,7 @@ namespace boost {
|
|||||||
template<typename SequenceT>
|
template<typename SequenceT>
|
||||||
inline void erase_head(
|
inline void erase_head(
|
||||||
SequenceT& Input,
|
SequenceT& Input,
|
||||||
unsigned int N )
|
int N )
|
||||||
{
|
{
|
||||||
find_format(
|
find_format(
|
||||||
Input,
|
Input,
|
||||||
@ -755,7 +755,7 @@ namespace boost {
|
|||||||
inline OutputIteratorT erase_tail_copy(
|
inline OutputIteratorT erase_tail_copy(
|
||||||
OutputIteratorT Output,
|
OutputIteratorT Output,
|
||||||
const RangeT& Input,
|
const RangeT& Input,
|
||||||
unsigned int N )
|
int N )
|
||||||
{
|
{
|
||||||
return find_format_copy(
|
return find_format_copy(
|
||||||
Output,
|
Output,
|
||||||
@ -771,7 +771,7 @@ namespace boost {
|
|||||||
template<typename SequenceT>
|
template<typename SequenceT>
|
||||||
inline SequenceT erase_tail_copy(
|
inline SequenceT erase_tail_copy(
|
||||||
const SequenceT& Input,
|
const SequenceT& Input,
|
||||||
unsigned int N )
|
int N )
|
||||||
{
|
{
|
||||||
return find_format_copy(
|
return find_format_copy(
|
||||||
Input,
|
Input,
|
||||||
@ -791,7 +791,7 @@ namespace boost {
|
|||||||
template<typename SequenceT>
|
template<typename SequenceT>
|
||||||
inline void erase_tail(
|
inline void erase_tail(
|
||||||
SequenceT& Input,
|
SequenceT& Input,
|
||||||
unsigned int N )
|
int N )
|
||||||
{
|
{
|
||||||
find_format(
|
find_format(
|
||||||
Input,
|
Input,
|
||||||
|
@ -188,7 +188,7 @@ namespace boost {
|
|||||||
find_nth(
|
find_nth(
|
||||||
Range1T& Input,
|
Range1T& Input,
|
||||||
const Range2T& Search,
|
const Range2T& Search,
|
||||||
unsigned int Nth)
|
int Nth)
|
||||||
{
|
{
|
||||||
return nth_finder(Search,Nth)(
|
return nth_finder(Search,Nth)(
|
||||||
begin(Input),end(Input));
|
begin(Input),end(Input));
|
||||||
@ -218,7 +218,7 @@ namespace boost {
|
|||||||
ifind_nth(
|
ifind_nth(
|
||||||
Range1T& Input,
|
Range1T& Input,
|
||||||
const Range2T& Search,
|
const Range2T& Search,
|
||||||
unsigned int Nth,
|
int Nth,
|
||||||
const std::locale& Loc=std::locale())
|
const std::locale& Loc=std::locale())
|
||||||
{
|
{
|
||||||
return nth_finder(Search,Nth,is_iequal(Loc))(
|
return nth_finder(Search,Nth,is_iequal(Loc))(
|
||||||
@ -248,7 +248,7 @@ namespace boost {
|
|||||||
BOOST_STRING_TYPENAME range_result_iterator<RangeT>::type>
|
BOOST_STRING_TYPENAME range_result_iterator<RangeT>::type>
|
||||||
find_head(
|
find_head(
|
||||||
RangeT& Input,
|
RangeT& Input,
|
||||||
unsigned int N)
|
int N)
|
||||||
{
|
{
|
||||||
return head_finder(N)(
|
return head_finder(N)(
|
||||||
begin(Input),end(Input));
|
begin(Input),end(Input));
|
||||||
@ -278,7 +278,7 @@ namespace boost {
|
|||||||
BOOST_STRING_TYPENAME range_result_iterator<RangeT>::type>
|
BOOST_STRING_TYPENAME range_result_iterator<RangeT>::type>
|
||||||
find_tail(
|
find_tail(
|
||||||
RangeT& Input,
|
RangeT& Input,
|
||||||
unsigned int N)
|
int N)
|
||||||
{
|
{
|
||||||
return tail_finder(N)(
|
return tail_finder(N)(
|
||||||
begin(Input),end(Input));
|
begin(Input),end(Input));
|
||||||
|
@ -132,7 +132,7 @@ namespace boost {
|
|||||||
is_equal>
|
is_equal>
|
||||||
nth_finder(
|
nth_finder(
|
||||||
const ContainerT& Search,
|
const ContainerT& Search,
|
||||||
unsigned int Nth)
|
int Nth)
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
detail::nth_finderF<
|
detail::nth_finderF<
|
||||||
@ -150,7 +150,7 @@ namespace boost {
|
|||||||
PredicateT>
|
PredicateT>
|
||||||
nth_finder(
|
nth_finder(
|
||||||
const ContainerT& Search,
|
const ContainerT& Search,
|
||||||
unsigned int Nth,
|
int Nth,
|
||||||
PredicateT Comp )
|
PredicateT Comp )
|
||||||
{
|
{
|
||||||
return
|
return
|
||||||
@ -172,7 +172,7 @@ namespace boost {
|
|||||||
\return An instance of the \c head_finder object
|
\return An instance of the \c head_finder object
|
||||||
*/
|
*/
|
||||||
inline detail::head_finderF
|
inline detail::head_finderF
|
||||||
head_finder( unsigned int N )
|
head_finder( int N )
|
||||||
{
|
{
|
||||||
return detail::head_finderF(N);
|
return detail::head_finderF(N);
|
||||||
}
|
}
|
||||||
@ -189,7 +189,7 @@ namespace boost {
|
|||||||
\return An instance of the \c tail_finder object
|
\return An instance of the \c tail_finder object
|
||||||
*/
|
*/
|
||||||
inline detail::tail_finderF
|
inline detail::tail_finderF
|
||||||
tail_finder( unsigned int N )
|
tail_finder( int N )
|
||||||
{
|
{
|
||||||
return detail::tail_finderF(N);
|
return detail::tail_finderF(N);
|
||||||
}
|
}
|
||||||
|
@ -443,7 +443,7 @@ namespace boost {
|
|||||||
OutputIteratorT Output,
|
OutputIteratorT Output,
|
||||||
const Range1T& Input,
|
const Range1T& Input,
|
||||||
const Range2T& Search,
|
const Range2T& Search,
|
||||||
unsigned int Nth,
|
int Nth,
|
||||||
const Range3T& Format )
|
const Range3T& Format )
|
||||||
{
|
{
|
||||||
return find_format_copy(
|
return find_format_copy(
|
||||||
@ -461,7 +461,7 @@ namespace boost {
|
|||||||
inline SequenceT replace_nth_copy(
|
inline SequenceT replace_nth_copy(
|
||||||
const SequenceT& Input,
|
const SequenceT& Input,
|
||||||
const Range1T& Search,
|
const Range1T& Search,
|
||||||
unsigned int Nth,
|
int Nth,
|
||||||
const Range2T& Format )
|
const Range2T& Format )
|
||||||
{
|
{
|
||||||
return find_format_copy(
|
return find_format_copy(
|
||||||
@ -484,7 +484,7 @@ namespace boost {
|
|||||||
inline void replace_nth(
|
inline void replace_nth(
|
||||||
SequenceT& Input,
|
SequenceT& Input,
|
||||||
const Range1T& Search,
|
const Range1T& Search,
|
||||||
unsigned int Nth,
|
int Nth,
|
||||||
const Range2T& Format )
|
const Range2T& Format )
|
||||||
{
|
{
|
||||||
find_format(
|
find_format(
|
||||||
@ -523,7 +523,7 @@ namespace boost {
|
|||||||
OutputIteratorT Output,
|
OutputIteratorT Output,
|
||||||
const Range1T& Input,
|
const Range1T& Input,
|
||||||
const Range2T& Search,
|
const Range2T& Search,
|
||||||
unsigned int Nth,
|
int Nth,
|
||||||
const Range3T& Format,
|
const Range3T& Format,
|
||||||
const std::locale& Loc=std::locale() )
|
const std::locale& Loc=std::locale() )
|
||||||
{
|
{
|
||||||
@ -542,7 +542,7 @@ namespace boost {
|
|||||||
inline SequenceT ireplace_nth_copy(
|
inline SequenceT ireplace_nth_copy(
|
||||||
const SequenceT& Input,
|
const SequenceT& Input,
|
||||||
const Range1T& Search,
|
const Range1T& Search,
|
||||||
unsigned int Nth,
|
int Nth,
|
||||||
const Range2T& Format,
|
const Range2T& Format,
|
||||||
const std::locale& Loc=std::locale() )
|
const std::locale& Loc=std::locale() )
|
||||||
{
|
{
|
||||||
@ -568,7 +568,7 @@ namespace boost {
|
|||||||
inline void ireplace_nth(
|
inline void ireplace_nth(
|
||||||
SequenceT& Input,
|
SequenceT& Input,
|
||||||
const Range1T& Search,
|
const Range1T& Search,
|
||||||
unsigned int Nth,
|
int Nth,
|
||||||
const Range2T& Format,
|
const Range2T& Format,
|
||||||
const std::locale& Loc=std::locale() )
|
const std::locale& Loc=std::locale() )
|
||||||
{
|
{
|
||||||
@ -759,7 +759,7 @@ namespace boost {
|
|||||||
inline OutputIteratorT replace_head_copy(
|
inline OutputIteratorT replace_head_copy(
|
||||||
OutputIteratorT Output,
|
OutputIteratorT Output,
|
||||||
const Range1T& Input,
|
const Range1T& Input,
|
||||||
unsigned int N,
|
int N,
|
||||||
const Range2T& Format )
|
const Range2T& Format )
|
||||||
{
|
{
|
||||||
return find_format_copy(
|
return find_format_copy(
|
||||||
@ -776,7 +776,7 @@ namespace boost {
|
|||||||
template<typename SequenceT, typename RangeT>
|
template<typename SequenceT, typename RangeT>
|
||||||
inline SequenceT replace_head_copy(
|
inline SequenceT replace_head_copy(
|
||||||
const SequenceT& Input,
|
const SequenceT& Input,
|
||||||
unsigned int N,
|
int N,
|
||||||
const RangeT& Format )
|
const RangeT& Format )
|
||||||
{
|
{
|
||||||
return find_format_copy(
|
return find_format_copy(
|
||||||
@ -799,7 +799,7 @@ namespace boost {
|
|||||||
template<typename SequenceT, typename RangeT>
|
template<typename SequenceT, typename RangeT>
|
||||||
inline void replace_head(
|
inline void replace_head(
|
||||||
SequenceT& Input,
|
SequenceT& Input,
|
||||||
unsigned int N,
|
int N,
|
||||||
const RangeT& Format )
|
const RangeT& Format )
|
||||||
{
|
{
|
||||||
find_format(
|
find_format(
|
||||||
@ -835,7 +835,7 @@ namespace boost {
|
|||||||
inline OutputIteratorT replace_tail_copy(
|
inline OutputIteratorT replace_tail_copy(
|
||||||
OutputIteratorT Output,
|
OutputIteratorT Output,
|
||||||
const Range1T& Input,
|
const Range1T& Input,
|
||||||
unsigned int N,
|
int N,
|
||||||
const Range2T& Format )
|
const Range2T& Format )
|
||||||
{
|
{
|
||||||
return find_format_copy(
|
return find_format_copy(
|
||||||
@ -852,7 +852,7 @@ namespace boost {
|
|||||||
template<typename SequenceT, typename RangeT>
|
template<typename SequenceT, typename RangeT>
|
||||||
inline SequenceT replace_tail_copy(
|
inline SequenceT replace_tail_copy(
|
||||||
const SequenceT& Input,
|
const SequenceT& Input,
|
||||||
unsigned int N,
|
int N,
|
||||||
const RangeT& Format )
|
const RangeT& Format )
|
||||||
{
|
{
|
||||||
return find_format_copy(
|
return find_format_copy(
|
||||||
@ -875,7 +875,7 @@ namespace boost {
|
|||||||
template<typename SequenceT, typename RangeT>
|
template<typename SequenceT, typename RangeT>
|
||||||
inline void replace_tail(
|
inline void replace_tail(
|
||||||
SequenceT& Input,
|
SequenceT& Input,
|
||||||
unsigned int N,
|
int N,
|
||||||
const RangeT& Format )
|
const RangeT& Format )
|
||||||
{
|
{
|
||||||
find_format(
|
find_format(
|
||||||
|
Reference in New Issue
Block a user