find_head/tail_impl functions reordered to avoid dependancy problems

[SVN r32893]
This commit is contained in:
Pavol Droba
2006-02-13 13:21:31 +00:00
parent e2b9172f5d
commit 3766cbbe5c

View File

@ -331,7 +331,7 @@ namespace boost {
PredicateT m_Comp;
};
// find head functor -----------------------------------------------//
// find head/tail implementation helpers ---------------------------//
template<typename ForwardIteratorT>
iterator_range<ForwardIteratorT>
@ -383,45 +383,6 @@ namespace boost {
return find_head_impl( Begin, End, N, category() );
}
// find a head in the sequence ( functor )
/*
This functor find a head of the specified range. For
a specified N, the head is a subsequence of N starting
elements of the range.
*/
struct head_finderF
{
// Construction
head_finderF( int N ) : m_N(N) {}
// Operation
template< typename ForwardIteratorT >
iterator_range<ForwardIteratorT>
operator()(
ForwardIteratorT Begin,
ForwardIteratorT End ) const
{
if(m_N>=0)
{
return find_head_impl( Begin, End, m_N );
}
else
{
iterator_range<ForwardIteratorT> Res=
find_tail_impl( Begin, End, -m_N );
return make_iterator_range(Begin, Res.begin());
}
}
private:
int m_N;
};
// find tail functor -----------------------------------------------//
template< typename ForwardIteratorT >
iterator_range<ForwardIteratorT>
find_tail_impl(
@ -497,6 +458,48 @@ namespace boost {
}
// find head functor -----------------------------------------------//
// find a head in the sequence ( functor )
/*
This functor find a head of the specified range. For
a specified N, the head is a subsequence of N starting
elements of the range.
*/
struct head_finderF
{
// Construction
head_finderF( int N ) : m_N(N) {}
// Operation
template< typename ForwardIteratorT >
iterator_range<ForwardIteratorT>
operator()(
ForwardIteratorT Begin,
ForwardIteratorT End ) const
{
if(m_N>=0)
{
return find_head_impl( Begin, End, m_N );
}
else
{
iterator_range<ForwardIteratorT> Res=
find_tail_impl( Begin, End, -m_N );
return make_iterator_range(Begin, Res.begin());
}
}
private:
int m_N;
};
// find tail functor -----------------------------------------------//
// find a tail in the sequence ( functor )
/*
This functor find a tail of the specified range. For