Revert "Add Erase(ConstValueIterator) and Erase(ConstValueIterator,ConstValueIterator)"
This reverts commit 9ab2621e855a9abb8377520b42d6dfddcd49a8e1.
This commit is contained in:
parent
9ab2621e85
commit
71ae5660ed
@ -1008,10 +1008,6 @@ int z = a[0u].GetInt(); // This works too.
|
|||||||
return Erase(pos, pos + 1);
|
return Erase(pos, pos + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
ValueIterator Erase(ConstValueIterator pos) {
|
|
||||||
return Erase(const_cast<ValueIterator>(pos));
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Remove elements in the range [first, last) of the array.
|
//! Remove elements in the range [first, last) of the array.
|
||||||
/*!
|
/*!
|
||||||
\param pos iterator to the element to remove
|
\param pos iterator to the element to remove
|
||||||
@ -1033,10 +1029,6 @@ int z = a[0u].GetInt(); // This works too.
|
|||||||
return first;
|
return first;
|
||||||
}
|
}
|
||||||
|
|
||||||
ValueIterator Erase(ConstValueIterator first, ConstValueIterator last) {
|
|
||||||
return Erase(const_cast<ValueIterator>(first), const_cast<ValueIterator>(last));
|
|
||||||
}
|
|
||||||
|
|
||||||
//@}
|
//@}
|
||||||
|
|
||||||
//!@name Number
|
//!@name Number
|
||||||
|
@ -628,11 +628,11 @@ TEST(Value, Array) {
|
|||||||
x.PushBack(Value(kArrayType).PushBack(i, allocator).Move(), allocator);
|
x.PushBack(Value(kArrayType).PushBack(i, allocator).Move(), allocator);
|
||||||
|
|
||||||
// Erase the first
|
// Erase the first
|
||||||
itr = x.Erase(y.Begin()); // const iteator is also OK
|
itr = x.Erase(x.Begin());
|
||||||
EXPECT_EQ(y.Begin(), itr);
|
EXPECT_EQ(x.Begin(), itr);
|
||||||
EXPECT_EQ(9u, y.Size());
|
EXPECT_EQ(9u, x.Size());
|
||||||
for (int i = 0; i < 9; i++)
|
for (int i = 0; i < 9; i++)
|
||||||
EXPECT_EQ(i + 1, y[i][0u].GetInt());
|
EXPECT_EQ(i + 1, x[i][0u].GetInt());
|
||||||
|
|
||||||
// Ease the last
|
// Ease the last
|
||||||
itr = x.Erase(x.End() - 1);
|
itr = x.Erase(x.End() - 1);
|
||||||
@ -659,7 +659,7 @@ TEST(Value, Array) {
|
|||||||
for (unsigned i = 0; i < n; i++)
|
for (unsigned i = 0; i < n; i++)
|
||||||
x.PushBack(Value(kArrayType).PushBack(i, allocator).Move(), allocator);
|
x.PushBack(Value(kArrayType).PushBack(i, allocator).Move(), allocator);
|
||||||
|
|
||||||
itr = x.Erase(y.Begin() + first, y.Begin() + last); // const iterator is also OK
|
itr = x.Erase(x.Begin() + first, x.Begin() + last);
|
||||||
if (last == n)
|
if (last == n)
|
||||||
EXPECT_EQ(x.End(), itr);
|
EXPECT_EQ(x.End(), itr);
|
||||||
else
|
else
|
||||||
|
Loading…
x
Reference in New Issue
Block a user