mirror of
https://github.com/boostorg/container.git
synced 2025-08-01 21:44:27 +02:00
Avoid instantiating iterator tags to allow iterators that define iterator_categories with forward declared tags.
This commit is contained in:
@@ -878,9 +878,7 @@ public:
|
||||
template <typename Iterator>
|
||||
iterator insert(iterator position, Iterator first, Iterator last)
|
||||
{
|
||||
typedef typename boost::container::iterator_traits<Iterator>::iterator_category category;
|
||||
this->insert_dispatch(position, first, last, category());
|
||||
|
||||
this->insert_dispatch(position, first, last);
|
||||
return position;
|
||||
}
|
||||
|
||||
@@ -961,8 +959,7 @@ public:
|
||||
template <typename Iterator>
|
||||
void assign(Iterator first, Iterator last)
|
||||
{
|
||||
typedef typename boost::container::iterator_traits<Iterator>::iterator_category category;
|
||||
this->assign_dispatch(first, last, category()); // may throw
|
||||
this->assign_dispatch(first, last); // may throw
|
||||
}
|
||||
|
||||
//! @pre <tt>count <= capacity()</tt>
|
||||
@@ -1698,7 +1695,8 @@ private:
|
||||
// @par Complexity
|
||||
// Linear O(N).
|
||||
template <typename Iterator>
|
||||
void insert_dispatch(iterator position, Iterator first, Iterator last, std::random_access_iterator_tag)
|
||||
typename iterator_enable_if_tag<Iterator, std::random_access_iterator_tag>::type
|
||||
insert_dispatch(iterator position, Iterator first, Iterator last)
|
||||
{
|
||||
errh::check_iterator_end_eq(*this, position);
|
||||
|
||||
@@ -1725,7 +1723,8 @@ private:
|
||||
// @par Complexity
|
||||
// Linear O(N).
|
||||
template <typename Iterator, typename Category>
|
||||
void insert_dispatch(iterator position, Iterator first, Iterator last, Category const& /*not_random_access*/)
|
||||
typename iterator_disable_if_tag<Iterator, std::random_access_iterator_tag>::type
|
||||
insert_dispatch(iterator position, Iterator first, Iterator last)
|
||||
{
|
||||
errh::check_iterator_end_eq(*this, position);
|
||||
|
||||
@@ -1791,7 +1790,8 @@ private:
|
||||
// @par Complexity
|
||||
// Linear O(N).
|
||||
template <typename Iterator>
|
||||
void assign_dispatch(Iterator first, Iterator last, std::random_access_iterator_tag const& /*not_random_access*/)
|
||||
typename iterator_enable_if_tag<Iterator, std::random_access_iterator_tag>::type
|
||||
assign_dispatch(Iterator first, Iterator last)
|
||||
{
|
||||
namespace sv = varray_detail;
|
||||
|
||||
@@ -1818,7 +1818,8 @@ private:
|
||||
// @par Complexity
|
||||
// Linear O(N).
|
||||
template <typename Iterator, typename Category>
|
||||
void assign_dispatch(Iterator first, Iterator last, Category const& /*not_random_access*/)
|
||||
typename iterator_disable_if_tag<Iterator, std::random_access_iterator_tag>::type
|
||||
assign_dispatch(Iterator first, Iterator last)
|
||||
{
|
||||
namespace sv = varray_detail;
|
||||
|
||||
|
@@ -605,8 +605,7 @@ class deque : protected deque_base<Allocator>
|
||||
)
|
||||
: Base(a)
|
||||
{
|
||||
typedef typename boost::container::iterator_traits<InIt>::iterator_category ItCat;
|
||||
this->priv_range_initialize(first, last, ItCat());
|
||||
this->priv_range_initialize(first, last);
|
||||
}
|
||||
|
||||
#if !defined(BOOST_NO_CXX11_HDR_INITIALIZER_LIST)
|
||||
@@ -620,7 +619,7 @@ class deque : protected deque_base<Allocator>
|
||||
deque(std::initializer_list<value_type> il, const allocator_type& a = allocator_type())
|
||||
: Base(a)
|
||||
{
|
||||
this->priv_range_initialize(il.begin(), il.end(), std::input_iterator_tag());
|
||||
this->priv_range_initialize(il.begin(), il.end());
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -1951,7 +1950,8 @@ class deque : protected deque_base<Allocator>
|
||||
}
|
||||
|
||||
template <class InIt>
|
||||
void priv_range_initialize(InIt first, InIt last, std::input_iterator_tag)
|
||||
typename iterator_enable_if_tag<InIt, std::input_iterator_tag>::type
|
||||
priv_range_initialize(InIt first, InIt last)
|
||||
{
|
||||
this->priv_initialize_map(0);
|
||||
BOOST_TRY {
|
||||
@@ -1966,7 +1966,8 @@ class deque : protected deque_base<Allocator>
|
||||
}
|
||||
|
||||
template <class FwdIt>
|
||||
void priv_range_initialize(FwdIt first, FwdIt last, std::forward_iterator_tag)
|
||||
typename iterator_disable_if_tag<FwdIt, std::input_iterator_tag>::type
|
||||
priv_range_initialize(FwdIt first, FwdIt last)
|
||||
{
|
||||
size_type n = 0;
|
||||
n = boost::container::iterator_distance(first, last);
|
||||
|
@@ -26,6 +26,8 @@ using ::boost::intrusive::iterator_traits;
|
||||
using ::boost::intrusive::iterator_distance;
|
||||
using ::boost::intrusive::iterator_advance;
|
||||
using ::boost::intrusive::iterator;
|
||||
using ::boost::intrusive::iterator_enable_if_tag;
|
||||
using ::boost::intrusive::iterator_disable_if_tag;
|
||||
|
||||
} //namespace container {
|
||||
} //namespace boost {
|
||||
|
Reference in New Issue
Block a user