forked from boostorg/range
Boost.Range modification in an attempt to improve the compatibility of the adjacent_filtered and uniqued adaptors.
[SVN r61142]
This commit is contained in:
@ -0,0 +1,96 @@
|
|||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
||||||
|
<title>iota</title>
|
||||||
|
<link rel="stylesheet" href="../../../../../../../../doc/html/boostbook.css" type="text/css">
|
||||||
|
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
|
||||||
|
<link rel="home" href="../../../../index.html" title="Chapter 1. Range 2.0">
|
||||||
|
<link rel="up" href="../range_algorithm_new_algorithms.html" title="New algorithms">
|
||||||
|
<link rel="prev" href="insert.html" title="insert">
|
||||||
|
<link rel="next" href="overwrite.html" title="overwrite">
|
||||||
|
</head>
|
||||||
|
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
||||||
|
<table cellpadding="2" width="100%"><tr>
|
||||||
|
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../../boost.png"></td>
|
||||||
|
<td align="center"><a href="../../../../../../../../index.html">Home</a></td>
|
||||||
|
<td align="center"><a href="../../../../../../../libraries.htm">Libraries</a></td>
|
||||||
|
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
|
||||||
|
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
|
||||||
|
<td align="center"><a href="../../../../../../../../more/index.htm">More</a></td>
|
||||||
|
</tr></table>
|
||||||
|
<hr>
|
||||||
|
<div class="spirit-nav">
|
||||||
|
<a accesskey="p" href="insert.html"><img src="../../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../range_algorithm_new_algorithms.html"><img src="../../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="overwrite.html"><img src="../../../../../../../../doc/html/images/next.png" alt="Next"></a>
|
||||||
|
</div>
|
||||||
|
<div class="section" title="iota">
|
||||||
|
<div class="titlepage"><div><div><h5 class="title">
|
||||||
|
<a name="range.reference.algorithms.range_algorithm_new_algorithms.iota"></a><a class="link" href="iota.html" title="iota">
|
||||||
|
iota</a>
|
||||||
|
</h5></div></div></div>
|
||||||
|
<a name="range.reference.algorithms.range_algorithm_new_algorithms.iota.prototype"></a><h6>
|
||||||
|
<a name="id716034"></a>
|
||||||
|
<a class="link" href="iota.html#range.reference.algorithms.range_algorithm_new_algorithms.iota.prototype">Prototype</a>
|
||||||
|
</h6>
|
||||||
|
<p>
|
||||||
|
|
||||||
|
</p>
|
||||||
|
<pre class="programlisting"><span class="keyword">template</span><span class="special"><</span><span class="keyword">class</span> <span class="identifier">SinglePassRange</span><span class="special">,</span> <span class="keyword">class</span> <span class="identifier">Value</span><span class="special">></span>
|
||||||
|
<span class="identifier">iota</span><span class="special">(</span><span class="identifier">SinglePassRange</span><span class="special">&</span> <span class="identifier">rng</span><span class="special">,</span> <span class="identifier">Value</span> <span class="identifier">x</span><span class="special">);</span>
|
||||||
|
</pre>
|
||||||
|
<p>
|
||||||
|
</p>
|
||||||
|
<a name="range.reference.algorithms.range_algorithm_new_algorithms.iota.description"></a><h6>
|
||||||
|
<a name="id716150"></a>
|
||||||
|
<a class="link" href="iota.html#range.reference.algorithms.range_algorithm_new_algorithms.iota.description">Description</a>
|
||||||
|
</h6>
|
||||||
|
<p>
|
||||||
|
<code class="computeroutput"><span class="identifier">iota</span></code> traverses forward
|
||||||
|
through <code class="computeroutput"><span class="identifier">rng</span></code>, each element
|
||||||
|
<code class="computeroutput"><span class="identifier">y</span></code> in <code class="computeroutput"><span class="identifier">rng</span></code>
|
||||||
|
is assigned a value equivalent to <code class="computeroutput"><span class="identifier">x</span>
|
||||||
|
<span class="special">+</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">distance</span><span class="special">(</span><span class="identifier">boost</span><span class="special">::</span><span class="identifier">begin</span><span class="special">(</span><span class="identifier">rng</span><span class="special">),</span> <span class="identifier">it</span><span class="special">)</span></code>
|
||||||
|
</p>
|
||||||
|
<a name="range.reference.algorithms.range_algorithm_new_algorithms.iota.definition"></a><h6>
|
||||||
|
<a name="id716288"></a>
|
||||||
|
<a class="link" href="iota.html#range.reference.algorithms.range_algorithm_new_algorithms.iota.definition">Definition</a>
|
||||||
|
</h6>
|
||||||
|
<p>
|
||||||
|
Defined in the header file <code class="computeroutput"><span class="identifier">boost</span><span class="special">/</span><span class="identifier">range</span><span class="special">/</span><span class="identifier">algorithm_ext</span><span class="special">/</span><span class="identifier">iota</span><span class="special">.</span><span class="identifier">hpp</span></code>
|
||||||
|
</p>
|
||||||
|
<a name="range.reference.algorithms.range_algorithm_new_algorithms.iota.requirements"></a><h6>
|
||||||
|
<a name="id716360"></a>
|
||||||
|
<a class="link" href="iota.html#range.reference.algorithms.range_algorithm_new_algorithms.iota.requirements">Requirements</a>
|
||||||
|
</h6>
|
||||||
|
<div class="orderedlist"><ol class="orderedlist" type="1">
|
||||||
|
<li class="listitem">
|
||||||
|
<code class="computeroutput"><span class="identifier">SinglePassRange</span></code> is
|
||||||
|
a model of the <a class="link" href="../../../concepts/single_pass_range.html" title="Single Pass Range">Single
|
||||||
|
Pass Range</a> Concept.
|
||||||
|
</li>
|
||||||
|
<li class="listitem">
|
||||||
|
<code class="computeroutput"><span class="identifier">Value</span></code> is a model of
|
||||||
|
the <code class="computeroutput"><span class="identifier">Incrementable</span></code> Concept.
|
||||||
|
</li>
|
||||||
|
</ol></div>
|
||||||
|
<a name="range.reference.algorithms.range_algorithm_new_algorithms.iota.complexity"></a><h6>
|
||||||
|
<a name="id716434"></a>
|
||||||
|
<a class="link" href="iota.html#range.reference.algorithms.range_algorithm_new_algorithms.iota.complexity">Complexity</a>
|
||||||
|
</h6>
|
||||||
|
<p>
|
||||||
|
Linear. Exactly <code class="computeroutput"><span class="identifier">distance</span><span class="special">(</span><span class="identifier">rng</span><span class="special">)</span></code> assignments into <code class="computeroutput"><span class="identifier">rng</span></code>.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
||||||
|
<td align="left"></td>
|
||||||
|
<td align="right"><div class="copyright-footer">Copyright © 2003 -2010 Thorsten Ottosen, Neil Groves<p>
|
||||||
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||||
|
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>)
|
||||||
|
</p>
|
||||||
|
</div></td>
|
||||||
|
</tr></table>
|
||||||
|
<hr>
|
||||||
|
<div class="spirit-nav">
|
||||||
|
<a accesskey="p" href="insert.html"><img src="../../../../../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../range_algorithm_new_algorithms.html"><img src="../../../../../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../../../index.html"><img src="../../../../../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="overwrite.html"><img src="../../../../../../../../doc/html/images/next.png" alt="Next"></a>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
@ -30,94 +30,58 @@ namespace boost
|
|||||||
|
|
||||||
namespace range_detail
|
namespace range_detail
|
||||||
{
|
{
|
||||||
template< class Iter, class R >
|
template< class Iter, class Pred, bool default_pass >
|
||||||
class skip_iterator
|
class skip_iterator
|
||||||
: public boost::iterator_adaptor< skip_iterator<Iter,R>, Iter >
|
: public boost::iterator_adaptor<
|
||||||
|
skip_iterator<Iter,Pred,default_pass>,
|
||||||
|
Iter,
|
||||||
|
BOOST_DEDUCED_TYPENAME std::iterator_traits<Iter>::value_type,
|
||||||
|
boost::forward_traversal_tag,
|
||||||
|
BOOST_DEDUCED_TYPENAME std::iterator_traits<Iter>::reference,
|
||||||
|
BOOST_DEDUCED_TYPENAME std::iterator_traits<Iter>::difference_type
|
||||||
|
>
|
||||||
|
, private Pred
|
||||||
{
|
{
|
||||||
private:
|
private:
|
||||||
typedef boost::iterator_adaptor< skip_iterator<Iter,R>, Iter >
|
typedef boost::iterator_adaptor<
|
||||||
base_t;
|
skip_iterator<Iter,Pred,default_pass>,
|
||||||
|
Iter,
|
||||||
R* m_range;
|
BOOST_DEDUCED_TYPENAME std::iterator_traits<Iter>::value_type,
|
||||||
|
boost::forward_traversal_tag,
|
||||||
|
BOOST_DEDUCED_TYPENAME std::iterator_traits<Iter>::reference,
|
||||||
|
BOOST_DEDUCED_TYPENAME std::iterator_traits<Iter>::difference_type
|
||||||
|
> base_t;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
typedef Iter wrapped_iter_t;
|
typedef Pred pred_t;
|
||||||
|
typedef Iter iter_t;
|
||||||
|
|
||||||
//
|
skip_iterator() : m_last() {}
|
||||||
// The iterators are bound to the lifetime of the
|
|
||||||
// range and may not exist on their own. Hence it makes no
|
|
||||||
// sense to e.g. wrap them in reverse_iterators
|
|
||||||
// (that can OTOH be done in advance).
|
|
||||||
//
|
|
||||||
typedef std::input_iterator_tag iterator_category;
|
|
||||||
|
|
||||||
explicit skip_iterator( R* r, Iter i )
|
skip_iterator(iter_t it, iter_t last, const Pred& pred)
|
||||||
: base_t(i), m_range(r) {}
|
: base_t(it)
|
||||||
|
, pred_t(pred)
|
||||||
template< class OtherIter, class R2>
|
, m_last(last)
|
||||||
skip_iterator( const skip_iterator<OtherIter,R2>& other )
|
|
||||||
: base_t( other.base() ), m_range(other.m_range) {}
|
|
||||||
|
|
||||||
R* get_range() const { return m_range; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
friend class boost::iterator_core_access;
|
|
||||||
|
|
||||||
void increment()
|
|
||||||
{
|
|
||||||
BOOST_ASSERT( m_range != 0 );
|
|
||||||
m_range->increment_impl( this->base_reference() );
|
|
||||||
}
|
|
||||||
|
|
||||||
//
|
|
||||||
// Not needed ... just apply a reverse_iterator
|
|
||||||
//
|
|
||||||
void decrement()
|
|
||||||
{
|
{
|
||||||
BOOST_ASSERT( false && "you can't decrement an adjacent_filter_iterator" );
|
move_to_next_valid();
|
||||||
}
|
}
|
||||||
|
|
||||||
template< class D >
|
template<class OtherIter>
|
||||||
void advance( D n )
|
skip_iterator( const skip_iterator<OtherIter, pred_t, default_pass>& other )
|
||||||
{
|
: base_t(other.base())
|
||||||
BOOST_ASSERT( false );
|
, pred_t(other)
|
||||||
}
|
, m_last(other.m_last) {}
|
||||||
|
|
||||||
};
|
void move_to_next_valid()
|
||||||
|
|
||||||
template< class P, class R >
|
|
||||||
struct adjacent_filter_range
|
|
||||||
: iterator_range< skip_iterator<
|
|
||||||
BOOST_DEDUCED_TYPENAME range_iterator<R>::type,
|
|
||||||
adjacent_filter_range<P,R>
|
|
||||||
>
|
|
||||||
>
|
|
||||||
{
|
|
||||||
private:
|
|
||||||
typedef skip_iterator<
|
|
||||||
BOOST_DEDUCED_TYPENAME range_iterator<R>::type,
|
|
||||||
adjacent_filter_range<P,R>
|
|
||||||
>
|
|
||||||
skip_iter;
|
|
||||||
typedef iterator_range<skip_iter>
|
|
||||||
base_range;
|
|
||||||
|
|
||||||
typedef BOOST_DEDUCED_TYPENAME range_iterator<R>::type raw_iterator;
|
|
||||||
|
|
||||||
P m_bi_pred;
|
|
||||||
|
|
||||||
// Get the first element in the half-open range that
|
|
||||||
// passes the filter predicate.
|
|
||||||
// The adjacent_filter_range must only contain values that pass
|
|
||||||
// through the filter.
|
|
||||||
static raw_iterator to_valid(raw_iterator it, raw_iterator last, const P& bi_pred, bool default_pass)
|
|
||||||
{
|
{
|
||||||
if (it != last)
|
iter_t& it = this->base_reference();
|
||||||
|
pred_t& bi_pred = *this;
|
||||||
|
if (it != m_last)
|
||||||
{
|
{
|
||||||
if (default_pass)
|
if (default_pass)
|
||||||
{
|
{
|
||||||
raw_iterator nxt = ::boost::next(it);
|
iter_t nxt = ::boost::next(it);
|
||||||
while (nxt != last && !bi_pred(*it, *nxt))
|
while (nxt != m_last && !bi_pred(*it, *nxt))
|
||||||
{
|
{
|
||||||
++it;
|
++it;
|
||||||
++nxt;
|
++nxt;
|
||||||
@ -125,41 +89,61 @@ namespace boost
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
raw_iterator nxt = ::boost::next(it);
|
iter_t nxt = ::boost::next(it);
|
||||||
for(; nxt != last; ++it, ++nxt)
|
for(; nxt != m_last; ++it, ++nxt)
|
||||||
{
|
{
|
||||||
if (bi_pred(*it, *nxt))
|
if (bi_pred(*it, *nxt))
|
||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (nxt == last)
|
if (nxt == m_last)
|
||||||
{
|
{
|
||||||
it = last;
|
it = m_last;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return it;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void increment()
|
||||||
|
{
|
||||||
|
iter_t& it = this->base_reference();
|
||||||
|
BOOST_ASSERT( it != m_last );
|
||||||
|
++it;
|
||||||
|
move_to_next_valid();
|
||||||
|
}
|
||||||
|
|
||||||
|
iter_t m_last;
|
||||||
|
};
|
||||||
|
|
||||||
|
template< class P, class R, bool default_pass >
|
||||||
|
struct adjacent_filter_range
|
||||||
|
: iterator_range< skip_iterator<
|
||||||
|
BOOST_DEDUCED_TYPENAME range_iterator<R>::type,
|
||||||
|
P,
|
||||||
|
default_pass
|
||||||
|
>
|
||||||
|
>
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
typedef skip_iterator<
|
||||||
|
BOOST_DEDUCED_TYPENAME range_iterator<R>::type,
|
||||||
|
P,
|
||||||
|
default_pass
|
||||||
|
>
|
||||||
|
skip_iter;
|
||||||
|
|
||||||
|
typedef iterator_range<skip_iter>
|
||||||
|
base_range;
|
||||||
|
|
||||||
|
typedef BOOST_DEDUCED_TYPENAME range_iterator<R>::type raw_iterator;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
adjacent_filter_range( const P& p, R& r, bool default_pass )
|
adjacent_filter_range( const P& p, R& r )
|
||||||
: base_range( skip_iter( this, to_valid(boost::begin(r), boost::end(r), p, default_pass)),
|
: base_range( skip_iter( boost::begin(r), boost::end(r), p),
|
||||||
skip_iter( this, boost::end(r) ) ),
|
skip_iter( boost::end(r), boost::end(r), p) )
|
||||||
m_bi_pred( p ),
|
|
||||||
m_default_pass(default_pass)
|
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
void increment_impl( raw_iterator& current )
|
|
||||||
{
|
|
||||||
BOOST_ASSERT( current != this->end().base() );
|
|
||||||
|
|
||||||
current = to_valid(::boost::next(current), this->end().base(), m_bi_pred, m_default_pass);
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool m_default_pass;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
template< class T >
|
template< class T >
|
||||||
@ -177,37 +161,37 @@ namespace boost
|
|||||||
};
|
};
|
||||||
|
|
||||||
template< class ForwardRng, class BinPredicate >
|
template< class ForwardRng, class BinPredicate >
|
||||||
inline adjacent_filter_range<BinPredicate, ForwardRng>
|
inline adjacent_filter_range<BinPredicate, ForwardRng, true>
|
||||||
operator|( ForwardRng& r,
|
operator|( ForwardRng& r,
|
||||||
const adjacent_holder<BinPredicate>& f )
|
const adjacent_holder<BinPredicate>& f )
|
||||||
{
|
{
|
||||||
return adjacent_filter_range<BinPredicate, ForwardRng>( f.val, r, true );
|
return adjacent_filter_range<BinPredicate, ForwardRng, true>( f.val, r );
|
||||||
}
|
}
|
||||||
|
|
||||||
template< class ForwardRng, class BinPredicate >
|
template< class ForwardRng, class BinPredicate >
|
||||||
inline adjacent_filter_range<BinPredicate, const ForwardRng>
|
inline adjacent_filter_range<BinPredicate, const ForwardRng, true>
|
||||||
operator|( const ForwardRng& r,
|
operator|( const ForwardRng& r,
|
||||||
const adjacent_holder<BinPredicate>& f )
|
const adjacent_holder<BinPredicate>& f )
|
||||||
{
|
{
|
||||||
return adjacent_filter_range<BinPredicate,
|
return adjacent_filter_range<BinPredicate,
|
||||||
const ForwardRng>( f.val, r, true );
|
const ForwardRng, true>( f.val, r );
|
||||||
}
|
}
|
||||||
|
|
||||||
template< class ForwardRng, class BinPredicate >
|
template< class ForwardRng, class BinPredicate >
|
||||||
inline adjacent_filter_range<BinPredicate, ForwardRng>
|
inline adjacent_filter_range<BinPredicate, ForwardRng, false>
|
||||||
operator|( ForwardRng& r,
|
operator|( ForwardRng& r,
|
||||||
const adjacent_excl_holder<BinPredicate>& f )
|
const adjacent_excl_holder<BinPredicate>& f )
|
||||||
{
|
{
|
||||||
return adjacent_filter_range<BinPredicate, ForwardRng>( f.val, r, false );
|
return adjacent_filter_range<BinPredicate, ForwardRng, false>( f.val, r );
|
||||||
}
|
}
|
||||||
|
|
||||||
template< class ForwardRng, class BinPredicate >
|
template< class ForwardRng, class BinPredicate >
|
||||||
inline adjacent_filter_range<BinPredicate, ForwardRng>
|
inline adjacent_filter_range<BinPredicate, ForwardRng, false>
|
||||||
operator|( const ForwardRng& r,
|
operator|( const ForwardRng& r,
|
||||||
const adjacent_excl_holder<BinPredicate>& f )
|
const adjacent_excl_holder<BinPredicate>& f )
|
||||||
{
|
{
|
||||||
return adjacent_filter_range<BinPredicate,
|
return adjacent_filter_range<BinPredicate,
|
||||||
const ForwardRng>( f.val, r, false );
|
const ForwardRng, false>( f.val, r );
|
||||||
}
|
}
|
||||||
|
|
||||||
} // 'range_detail'
|
} // 'range_detail'
|
||||||
@ -231,17 +215,17 @@ namespace boost
|
|||||||
}
|
}
|
||||||
|
|
||||||
template<class ForwardRng, class BinPredicate>
|
template<class ForwardRng, class BinPredicate>
|
||||||
inline adjacent_filter_range<BinPredicate, ForwardRng>
|
inline adjacent_filter_range<BinPredicate, ForwardRng, true>
|
||||||
adjacent_filter(ForwardRng& rng, BinPredicate filter_pred, bool default_pass = true)
|
adjacent_filter(ForwardRng& rng, BinPredicate filter_pred)
|
||||||
{
|
{
|
||||||
return adjacent_filter_range<BinPredicate, ForwardRng>(filter_pred, rng, default_pass);
|
return adjacent_filter_range<BinPredicate, ForwardRng, true>(filter_pred, rng);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class ForwardRng, class BinPredicate>
|
template<class ForwardRng, class BinPredicate>
|
||||||
inline adjacent_filter_range<BinPredicate, const ForwardRng>
|
inline adjacent_filter_range<BinPredicate, const ForwardRng, true>
|
||||||
adjacent_filter(const ForwardRng& rng, BinPredicate filter_pred, bool default_pass = true)
|
adjacent_filter(const ForwardRng& rng, BinPredicate filter_pred)
|
||||||
{
|
{
|
||||||
return adjacent_filter_range<BinPredicate, const ForwardRng>(filter_pred, rng, default_pass);
|
return adjacent_filter_range<BinPredicate, const ForwardRng, true>(filter_pred, rng);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // 'adaptors'
|
} // 'adaptors'
|
||||||
|
@ -15,68 +15,68 @@
|
|||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
{
|
{
|
||||||
|
|
||||||
namespace range_detail
|
namespace range_detail
|
||||||
{
|
{
|
||||||
struct unique_forwarder { };
|
struct unique_forwarder { };
|
||||||
|
|
||||||
struct unique_not_equal_to
|
struct unique_not_equal_to
|
||||||
{
|
{
|
||||||
typedef bool result_type;
|
typedef bool result_type;
|
||||||
|
|
||||||
template< class T >
|
template< class T >
|
||||||
bool operator()( const T& l, const T& r ) const
|
bool operator()( const T& l, const T& r ) const
|
||||||
{
|
{
|
||||||
return !(l == r);
|
return !(l == r);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class ForwardRng>
|
template<class ForwardRng>
|
||||||
class unique_range : public adjacent_filter_range<unique_not_equal_to, ForwardRng>
|
class unique_range : public adjacent_filter_range<unique_not_equal_to, ForwardRng, true>
|
||||||
{
|
{
|
||||||
typedef adjacent_filter_range<unique_not_equal_to, ForwardRng> base;
|
typedef adjacent_filter_range<unique_not_equal_to, ForwardRng, true> base;
|
||||||
public:
|
public:
|
||||||
explicit unique_range(ForwardRng& rng)
|
explicit unique_range(ForwardRng& rng)
|
||||||
: base(unique_not_equal_to(), rng, true)
|
: base(unique_not_equal_to(), rng)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
template< class ForwardRng >
|
template< class ForwardRng >
|
||||||
inline unique_range<ForwardRng>
|
inline unique_range<ForwardRng>
|
||||||
operator|( ForwardRng& r,
|
operator|( ForwardRng& r,
|
||||||
unique_forwarder )
|
unique_forwarder )
|
||||||
{
|
{
|
||||||
return unique_range<ForwardRng>(r);
|
return unique_range<ForwardRng>(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
template< class ForwardRng >
|
template< class ForwardRng >
|
||||||
inline unique_range<const ForwardRng>
|
inline unique_range<const ForwardRng>
|
||||||
operator|( const ForwardRng& r,
|
operator|( const ForwardRng& r,
|
||||||
unique_forwarder )
|
unique_forwarder )
|
||||||
{
|
{
|
||||||
return unique_range<const ForwardRng>(r);
|
return unique_range<const ForwardRng>(r);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // 'range_detail'
|
} // 'range_detail'
|
||||||
|
|
||||||
using range_detail::unique_range;
|
using range_detail::unique_range;
|
||||||
|
|
||||||
namespace adaptors
|
namespace adaptors
|
||||||
{
|
{
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
const range_detail::unique_forwarder uniqued =
|
const range_detail::unique_forwarder uniqued =
|
||||||
range_detail::unique_forwarder();
|
range_detail::unique_forwarder();
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class ForwardRange>
|
template<class ForwardRange>
|
||||||
inline unique_range<ForwardRange>
|
inline unique_range<ForwardRange>
|
||||||
unique(ForwardRange& rng)
|
unique(ForwardRange& rng)
|
||||||
{
|
{
|
||||||
return unique_range<ForwardRange>(rng);
|
return unique_range<ForwardRange>(rng);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class ForwardRange>
|
template<class ForwardRange>
|
||||||
inline unique_range<const ForwardRange>
|
inline unique_range<const ForwardRange>
|
||||||
unique(const ForwardRange& rng)
|
unique(const ForwardRange& rng)
|
||||||
@ -84,7 +84,7 @@ namespace boost
|
|||||||
return unique_range<const ForwardRange>(rng);
|
return unique_range<const ForwardRange>(rng);
|
||||||
}
|
}
|
||||||
} // 'adaptors'
|
} // 'adaptors'
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user