Fix warnings in deque tests
git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@242632 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
b0be44f963
commit
18dbed9596
@ -2029,7 +2029,6 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_ty
|
|||||||
if (__n > __front_spare())
|
if (__n > __front_spare())
|
||||||
__add_front_capacity(__n - __front_spare());
|
__add_front_capacity(__n - __front_spare());
|
||||||
// __n <= __front_spare()
|
// __n <= __front_spare()
|
||||||
size_type __old_n = __n;
|
|
||||||
iterator __old_begin = __base::begin();
|
iterator __old_begin = __base::begin();
|
||||||
iterator __i = __old_begin;
|
iterator __i = __old_begin;
|
||||||
if (__n > __pos)
|
if (__n > __pos)
|
||||||
@ -2054,7 +2053,6 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, size_type __n, const value_ty
|
|||||||
if (__n > __back_capacity)
|
if (__n > __back_capacity)
|
||||||
__add_back_capacity(__n - __back_capacity);
|
__add_back_capacity(__n - __back_capacity);
|
||||||
// __n <= __back_capacity
|
// __n <= __back_capacity
|
||||||
size_type __old_n = __n;
|
|
||||||
iterator __old_end = __base::end();
|
iterator __old_end = __base::end();
|
||||||
iterator __i = __old_end;
|
iterator __i = __old_end;
|
||||||
size_type __de = __base::size() - __pos;
|
size_type __de = __base::size() - __pos;
|
||||||
@ -2119,7 +2117,6 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, _BiIter __f, _BiIter __l,
|
|||||||
if (__n > __front_spare())
|
if (__n > __front_spare())
|
||||||
__add_front_capacity(__n - __front_spare());
|
__add_front_capacity(__n - __front_spare());
|
||||||
// __n <= __front_spare()
|
// __n <= __front_spare()
|
||||||
size_type __old_n = __n;
|
|
||||||
iterator __old_begin = __base::begin();
|
iterator __old_begin = __base::begin();
|
||||||
iterator __i = __old_begin;
|
iterator __i = __old_begin;
|
||||||
_BiIter __m = __f;
|
_BiIter __m = __f;
|
||||||
@ -2150,7 +2147,6 @@ deque<_Tp, _Allocator>::insert(const_iterator __p, _BiIter __f, _BiIter __l,
|
|||||||
if (__n > __back_capacity)
|
if (__n > __back_capacity)
|
||||||
__add_back_capacity(__n - __back_capacity);
|
__add_back_capacity(__n - __back_capacity);
|
||||||
// __n <= __back_capacity
|
// __n <= __back_capacity
|
||||||
size_type __old_n = __n;
|
|
||||||
iterator __old_end = __base::end();
|
iterator __old_end = __base::end();
|
||||||
iterator __i = __old_end;
|
iterator __i = __old_end;
|
||||||
_BiIter __m = __l;
|
_BiIter __m = __l;
|
||||||
@ -2685,7 +2681,6 @@ template <class _Tp, class _Allocator>
|
|||||||
typename deque<_Tp, _Allocator>::iterator
|
typename deque<_Tp, _Allocator>::iterator
|
||||||
deque<_Tp, _Allocator>::erase(const_iterator __f)
|
deque<_Tp, _Allocator>::erase(const_iterator __f)
|
||||||
{
|
{
|
||||||
difference_type __n = 1;
|
|
||||||
iterator __b = __base::begin();
|
iterator __b = __base::begin();
|
||||||
difference_type __pos = __f - __b;
|
difference_type __pos = __f - __b;
|
||||||
iterator __p = __b + __pos;
|
iterator __p = __b + __pos;
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include <deque>
|
#include <deque>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
#include "test_macros.h"
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
|
|
||||||
template <class C>
|
template <class C>
|
||||||
@ -58,7 +59,6 @@ template <class C>
|
|||||||
void
|
void
|
||||||
testN(int start, int N, int M)
|
testN(int start, int N, int M)
|
||||||
{
|
{
|
||||||
typedef typename C::const_iterator CI;
|
|
||||||
C c1 = make<C>(N, start);
|
C c1 = make<C>(N, start);
|
||||||
test(c1, M);
|
test(c1, M);
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ int main()
|
|||||||
for (int k = 0; k < N; ++k)
|
for (int k = 0; k < N; ++k)
|
||||||
testN<std::deque<int> >(rng[i], rng[j], rng[k]);
|
testN<std::deque<int> >(rng[i], rng[j], rng[k]);
|
||||||
}
|
}
|
||||||
#if __cplusplus >= 201103L
|
#if TEST_STD_VER >= 11
|
||||||
{
|
{
|
||||||
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
|
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
|
||||||
const int N = sizeof(rng)/sizeof(rng[0]);
|
const int N = sizeof(rng)/sizeof(rng[0]);
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include <deque>
|
#include <deque>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
#include "test_macros.h"
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
|
|
||||||
template <class C>
|
template <class C>
|
||||||
@ -58,7 +59,6 @@ template <class C>
|
|||||||
void
|
void
|
||||||
testN(int start, int N, int M)
|
testN(int start, int N, int M)
|
||||||
{
|
{
|
||||||
typedef typename C::const_iterator CI;
|
|
||||||
C c1 = make<C>(N, start);
|
C c1 = make<C>(N, start);
|
||||||
test(c1, M, -10);
|
test(c1, M, -10);
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ int main()
|
|||||||
for (int k = 0; k < N; ++k)
|
for (int k = 0; k < N; ++k)
|
||||||
testN<std::deque<int> >(rng[i], rng[j], rng[k]);
|
testN<std::deque<int> >(rng[i], rng[j], rng[k]);
|
||||||
}
|
}
|
||||||
#if __cplusplus >= 201103L
|
#if TEST_STD_VER >= 11
|
||||||
{
|
{
|
||||||
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
|
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
|
||||||
const int N = sizeof(rng)/sizeof(rng[0]);
|
const int N = sizeof(rng)/sizeof(rng[0]);
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include <deque>
|
#include <deque>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
#include "test_macros.h"
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
|
|
||||||
template <class C>
|
template <class C>
|
||||||
@ -51,7 +52,6 @@ template <class C>
|
|||||||
void
|
void
|
||||||
testN(int start, int N)
|
testN(int start, int N)
|
||||||
{
|
{
|
||||||
typedef typename C::const_iterator CI;
|
|
||||||
C c1 = make<C>(N, start);
|
C c1 = make<C>(N, start);
|
||||||
test(c1);
|
test(c1);
|
||||||
}
|
}
|
||||||
@ -65,7 +65,7 @@ int main()
|
|||||||
for (int j = 0; j < N; ++j)
|
for (int j = 0; j < N; ++j)
|
||||||
testN<std::deque<int> >(rng[i], rng[j]);
|
testN<std::deque<int> >(rng[i], rng[j]);
|
||||||
}
|
}
|
||||||
#if __cplusplus >= 201103L
|
#if TEST_STD_VER >= 11
|
||||||
{
|
{
|
||||||
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
|
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
|
||||||
const int N = sizeof(rng)/sizeof(rng[0]);
|
const int N = sizeof(rng)/sizeof(rng[0]);
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#include <deque>
|
#include <deque>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
#include "test_macros.h"
|
||||||
#include "test_iterators.h"
|
#include "test_iterators.h"
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
|
|
||||||
@ -44,7 +45,6 @@ template <class C>
|
|||||||
void
|
void
|
||||||
test(C& c1, const C& c2)
|
test(C& c1, const C& c2)
|
||||||
{
|
{
|
||||||
std::size_t c1_osize = c1.size();
|
|
||||||
c1.assign(c2.begin(), c2.end());
|
c1.assign(c2.begin(), c2.end());
|
||||||
assert(distance(c1.begin(), c1.end()) == c1.size());
|
assert(distance(c1.begin(), c1.end()) == c1.size());
|
||||||
assert(c1 == c2);
|
assert(c1 == c2);
|
||||||
@ -54,8 +54,6 @@ template <class C>
|
|||||||
void
|
void
|
||||||
testN(int start, int N, int M)
|
testN(int start, int N, int M)
|
||||||
{
|
{
|
||||||
typedef typename C::iterator I;
|
|
||||||
typedef typename C::const_iterator CI;
|
|
||||||
C c1 = make<C>(N, start);
|
C c1 = make<C>(N, start);
|
||||||
C c2 = make<C>(M);
|
C c2 = make<C>(M);
|
||||||
test(c1, c2);
|
test(c1, c2);
|
||||||
@ -67,7 +65,6 @@ testI(C& c1, const C& c2)
|
|||||||
{
|
{
|
||||||
typedef typename C::const_iterator CI;
|
typedef typename C::const_iterator CI;
|
||||||
typedef input_iterator<CI> ICI;
|
typedef input_iterator<CI> ICI;
|
||||||
std::size_t c1_osize = c1.size();
|
|
||||||
c1.assign(ICI(c2.begin()), ICI(c2.end()));
|
c1.assign(ICI(c2.begin()), ICI(c2.end()));
|
||||||
assert(distance(c1.begin(), c1.end()) == c1.size());
|
assert(distance(c1.begin(), c1.end()) == c1.size());
|
||||||
assert(c1 == c2);
|
assert(c1 == c2);
|
||||||
@ -77,8 +74,6 @@ template <class C>
|
|||||||
void
|
void
|
||||||
testNI(int start, int N, int M)
|
testNI(int start, int N, int M)
|
||||||
{
|
{
|
||||||
typedef typename C::iterator I;
|
|
||||||
typedef typename C::const_iterator CI;
|
|
||||||
C c1 = make<C>(N, start);
|
C c1 = make<C>(N, start);
|
||||||
C c2 = make<C>(M);
|
C c2 = make<C>(M);
|
||||||
testI(c1, c2);
|
testI(c1, c2);
|
||||||
@ -95,7 +90,7 @@ int main()
|
|||||||
testN<std::deque<int> >(rng[i], rng[j], rng[k]);
|
testN<std::deque<int> >(rng[i], rng[j], rng[k]);
|
||||||
testNI<std::deque<int> >(1500, 2000, 1000);
|
testNI<std::deque<int> >(1500, 2000, 1000);
|
||||||
}
|
}
|
||||||
#if __cplusplus >= 201103L
|
#if TEST_STD_VER >= 11
|
||||||
{
|
{
|
||||||
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
|
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
|
||||||
const int N = sizeof(rng)/sizeof(rng[0]);
|
const int N = sizeof(rng)/sizeof(rng[0]);
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include <deque>
|
#include <deque>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
#include "test_macros.h"
|
||||||
#include "test_iterators.h"
|
#include "test_iterators.h"
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
|
|
||||||
@ -44,7 +45,6 @@ void
|
|||||||
test(C& c1, int size, int v)
|
test(C& c1, int size, int v)
|
||||||
{
|
{
|
||||||
typedef typename C::const_iterator CI;
|
typedef typename C::const_iterator CI;
|
||||||
std::size_t c1_osize = c1.size();
|
|
||||||
c1.assign(size, v);
|
c1.assign(size, v);
|
||||||
assert(c1.size() == size);
|
assert(c1.size() == size);
|
||||||
assert(distance(c1.begin(), c1.end()) == c1.size());
|
assert(distance(c1.begin(), c1.end()) == c1.size());
|
||||||
@ -56,8 +56,6 @@ template <class C>
|
|||||||
void
|
void
|
||||||
testN(int start, int N, int M)
|
testN(int start, int N, int M)
|
||||||
{
|
{
|
||||||
typedef typename C::iterator I;
|
|
||||||
typedef typename C::const_iterator CI;
|
|
||||||
C c1 = make<C>(N, start);
|
C c1 = make<C>(N, start);
|
||||||
test(c1, M, -10);
|
test(c1, M, -10);
|
||||||
}
|
}
|
||||||
@ -72,7 +70,7 @@ int main()
|
|||||||
for (int k = 0; k < N; ++k)
|
for (int k = 0; k < N; ++k)
|
||||||
testN<std::deque<int> >(rng[i], rng[j], rng[k]);
|
testN<std::deque<int> >(rng[i], rng[j], rng[k]);
|
||||||
}
|
}
|
||||||
#if __cplusplus >= 201103L
|
#if TEST_STD_VER >= 11
|
||||||
{
|
{
|
||||||
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
|
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
|
||||||
const int N = sizeof(rng)/sizeof(rng[0]);
|
const int N = sizeof(rng)/sizeof(rng[0]);
|
||||||
|
@ -11,13 +11,14 @@
|
|||||||
|
|
||||||
// template <class... Args> iterator emplace(const_iterator p, Args&&... args);
|
// template <class... Args> iterator emplace(const_iterator p, Args&&... args);
|
||||||
|
|
||||||
|
// UNSUPPORTED: c++98, c++03
|
||||||
|
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "../../../Emplaceable.h"
|
#include "../../../Emplaceable.h"
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
|
|
||||||
template <class C>
|
template <class C>
|
||||||
C
|
C
|
||||||
@ -45,7 +46,6 @@ template <class C>
|
|||||||
void
|
void
|
||||||
test(int P, C& c1)
|
test(int P, C& c1)
|
||||||
{
|
{
|
||||||
typedef typename C::iterator I;
|
|
||||||
typedef typename C::const_iterator CI;
|
typedef typename C::const_iterator CI;
|
||||||
std::size_t c1_osize = c1.size();
|
std::size_t c1_osize = c1.size();
|
||||||
CI i = c1.emplace(c1.begin() + P, Emplaceable(1, 2.5));
|
CI i = c1.emplace(c1.begin() + P, Emplaceable(1, 2.5));
|
||||||
@ -59,8 +59,6 @@ template <class C>
|
|||||||
void
|
void
|
||||||
testN(int start, int N)
|
testN(int start, int N)
|
||||||
{
|
{
|
||||||
typedef typename C::iterator I;
|
|
||||||
typedef typename C::const_iterator CI;
|
|
||||||
for (int i = 0; i <= 3; ++i)
|
for (int i = 0; i <= 3; ++i)
|
||||||
{
|
{
|
||||||
if (0 <= i && i <= N)
|
if (0 <= i && i <= N)
|
||||||
@ -87,11 +85,9 @@ testN(int start, int N)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
{
|
{
|
||||||
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
|
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
|
||||||
const int N = sizeof(rng)/sizeof(rng[0]);
|
const int N = sizeof(rng)/sizeof(rng[0]);
|
||||||
@ -99,7 +95,6 @@ int main()
|
|||||||
for (int j = 0; j < N; ++j)
|
for (int j = 0; j < N; ++j)
|
||||||
testN<std::deque<Emplaceable> >(rng[i], rng[j]);
|
testN<std::deque<Emplaceable> >(rng[i], rng[j]);
|
||||||
}
|
}
|
||||||
#if __cplusplus >= 201103L
|
|
||||||
{
|
{
|
||||||
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
|
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
|
||||||
const int N = sizeof(rng)/sizeof(rng[0]);
|
const int N = sizeof(rng)/sizeof(rng[0]);
|
||||||
@ -107,6 +102,4 @@ int main()
|
|||||||
for (int j = 0; j < N; ++j)
|
for (int j = 0; j < N; ++j)
|
||||||
testN<std::deque<Emplaceable, min_allocator<Emplaceable>> >(rng[i], rng[j]);
|
testN<std::deque<Emplaceable, min_allocator<Emplaceable>> >(rng[i], rng[j]);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
}
|
}
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include <deque>
|
#include <deque>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
#include "test_macros.h"
|
||||||
#include "test_iterators.h"
|
#include "test_iterators.h"
|
||||||
#include "MoveOnly.h"
|
#include "MoveOnly.h"
|
||||||
#include "../../../stack_allocator.h"
|
#include "../../../stack_allocator.h"
|
||||||
@ -49,7 +50,6 @@ void
|
|||||||
test(int P, const C& c0, const C& c2)
|
test(int P, const C& c0, const C& c2)
|
||||||
{
|
{
|
||||||
{
|
{
|
||||||
typedef typename C::iterator I;
|
|
||||||
typedef typename C::const_iterator CI;
|
typedef typename C::const_iterator CI;
|
||||||
typedef input_iterator<CI> BCI;
|
typedef input_iterator<CI> BCI;
|
||||||
C c1 = c0;
|
C c1 = c0;
|
||||||
@ -67,7 +67,6 @@ test(int P, const C& c0, const C& c2)
|
|||||||
assert(*i == j);
|
assert(*i == j);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
typedef typename C::iterator I;
|
|
||||||
typedef typename C::const_iterator CI;
|
typedef typename C::const_iterator CI;
|
||||||
typedef forward_iterator<CI> BCI;
|
typedef forward_iterator<CI> BCI;
|
||||||
C c1 = c0;
|
C c1 = c0;
|
||||||
@ -85,7 +84,6 @@ test(int P, const C& c0, const C& c2)
|
|||||||
assert(*i == j);
|
assert(*i == j);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
typedef typename C::iterator I;
|
|
||||||
typedef typename C::const_iterator CI;
|
typedef typename C::const_iterator CI;
|
||||||
typedef bidirectional_iterator<CI> BCI;
|
typedef bidirectional_iterator<CI> BCI;
|
||||||
C c1 = c0;
|
C c1 = c0;
|
||||||
@ -108,8 +106,6 @@ template <class C>
|
|||||||
void
|
void
|
||||||
testN(int start, int N, int M)
|
testN(int start, int N, int M)
|
||||||
{
|
{
|
||||||
typedef typename C::iterator I;
|
|
||||||
typedef typename C::const_iterator CI;
|
|
||||||
for (int i = 0; i <= 3; ++i)
|
for (int i = 0; i <= 3; ++i)
|
||||||
{
|
{
|
||||||
if (0 <= i && i <= N)
|
if (0 <= i && i <= N)
|
||||||
@ -170,7 +166,6 @@ template <class C>
|
|||||||
void
|
void
|
||||||
testI(int P, C& c1, const C& c2)
|
testI(int P, C& c1, const C& c2)
|
||||||
{
|
{
|
||||||
typedef typename C::iterator I;
|
|
||||||
typedef typename C::const_iterator CI;
|
typedef typename C::const_iterator CI;
|
||||||
typedef input_iterator<CI> ICI;
|
typedef input_iterator<CI> ICI;
|
||||||
std::size_t c1_osize = c1.size();
|
std::size_t c1_osize = c1.size();
|
||||||
@ -191,8 +186,6 @@ template <class C>
|
|||||||
void
|
void
|
||||||
testNI(int start, int N, int M)
|
testNI(int start, int N, int M)
|
||||||
{
|
{
|
||||||
typedef typename C::iterator I;
|
|
||||||
typedef typename C::const_iterator CI;
|
|
||||||
for (int i = 0; i <= 3; ++i)
|
for (int i = 0; i <= 3; ++i)
|
||||||
{
|
{
|
||||||
if (0 <= i && i <= N)
|
if (0 <= i && i <= N)
|
||||||
@ -244,7 +237,7 @@ template <class C>
|
|||||||
void
|
void
|
||||||
test_move()
|
test_move()
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#if TEST_STD_VER >= 11
|
||||||
C c;
|
C c;
|
||||||
typedef typename C::const_iterator CI;
|
typedef typename C::const_iterator CI;
|
||||||
{
|
{
|
||||||
@ -263,7 +256,7 @@ test_move()
|
|||||||
j = 0;
|
j = 0;
|
||||||
for (CI i = c.begin(); i != c.end(); ++i, ++j)
|
for (CI i = c.begin(); i != c.end(); ++i, ++j)
|
||||||
assert(*i == MoveOnly(j));
|
assert(*i == MoveOnly(j));
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
@ -276,11 +269,11 @@ int main()
|
|||||||
for (int k = 0; k < N; ++k)
|
for (int k = 0; k < N; ++k)
|
||||||
testN<std::deque<int> >(rng[i], rng[j], rng[k]);
|
testN<std::deque<int> >(rng[i], rng[j], rng[k]);
|
||||||
testNI<std::deque<int> >(1500, 2000, 1000);
|
testNI<std::deque<int> >(1500, 2000, 1000);
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#if TEST_STD_VER >= 11
|
||||||
test_move<std::deque<MoveOnly, stack_allocator<MoveOnly, 2000> > >();
|
test_move<std::deque<MoveOnly, stack_allocator<MoveOnly, 2000> > >();
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
#endif
|
||||||
}
|
}
|
||||||
#if __cplusplus >= 201103L
|
#if TEST_STD_VER >= 11
|
||||||
{
|
{
|
||||||
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
|
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
|
||||||
const int N = sizeof(rng)/sizeof(rng[0]);
|
const int N = sizeof(rng)/sizeof(rng[0]);
|
||||||
|
@ -11,13 +11,14 @@
|
|||||||
|
|
||||||
// iterator insert (const_iterator p, value_type&& v);
|
// iterator insert (const_iterator p, value_type&& v);
|
||||||
|
|
||||||
|
// UNSUPPORTED: c++98, c++03
|
||||||
|
|
||||||
#include <deque>
|
#include <deque>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
#include "MoveOnly.h"
|
#include "MoveOnly.h"
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
|
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
|
|
||||||
template <class C>
|
template <class C>
|
||||||
C
|
C
|
||||||
@ -45,7 +46,6 @@ template <class C>
|
|||||||
void
|
void
|
||||||
test(int P, C& c1, int x)
|
test(int P, C& c1, int x)
|
||||||
{
|
{
|
||||||
typedef typename C::iterator I;
|
|
||||||
typedef typename C::const_iterator CI;
|
typedef typename C::const_iterator CI;
|
||||||
std::size_t c1_osize = c1.size();
|
std::size_t c1_osize = c1.size();
|
||||||
CI i = c1.insert(c1.begin() + P, MoveOnly(x));
|
CI i = c1.insert(c1.begin() + P, MoveOnly(x));
|
||||||
@ -65,8 +65,6 @@ template <class C>
|
|||||||
void
|
void
|
||||||
testN(int start, int N)
|
testN(int start, int N)
|
||||||
{
|
{
|
||||||
typedef typename C::iterator I;
|
|
||||||
typedef typename C::const_iterator CI;
|
|
||||||
for (int i = 0; i <= 3; ++i)
|
for (int i = 0; i <= 3; ++i)
|
||||||
{
|
{
|
||||||
if (0 <= i && i <= N)
|
if (0 <= i && i <= N)
|
||||||
@ -93,11 +91,8 @@ testN(int start, int N)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
#ifndef _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
{
|
{
|
||||||
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
|
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
|
||||||
const int N = sizeof(rng)/sizeof(rng[0]);
|
const int N = sizeof(rng)/sizeof(rng[0]);
|
||||||
@ -105,7 +100,6 @@ int main()
|
|||||||
for (int j = 0; j < N; ++j)
|
for (int j = 0; j < N; ++j)
|
||||||
testN<std::deque<MoveOnly> >(rng[i], rng[j]);
|
testN<std::deque<MoveOnly> >(rng[i], rng[j]);
|
||||||
}
|
}
|
||||||
#if __cplusplus >= 201103L
|
|
||||||
{
|
{
|
||||||
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
|
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
|
||||||
const int N = sizeof(rng)/sizeof(rng[0]);
|
const int N = sizeof(rng)/sizeof(rng[0]);
|
||||||
@ -113,6 +107,4 @@ int main()
|
|||||||
for (int j = 0; j < N; ++j)
|
for (int j = 0; j < N; ++j)
|
||||||
testN<std::deque<MoveOnly, min_allocator<MoveOnly>> >(rng[i], rng[j]);
|
testN<std::deque<MoveOnly, min_allocator<MoveOnly>> >(rng[i], rng[j]);
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
#endif // _LIBCPP_HAS_NO_RVALUE_REFERENCES
|
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#include <deque>
|
#include <deque>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
#include "test_macros.h"
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
|
|
||||||
template <class C>
|
template <class C>
|
||||||
@ -44,7 +45,6 @@ template <class C>
|
|||||||
void
|
void
|
||||||
test(int P, C& c1, int size, int x)
|
test(int P, C& c1, int size, int x)
|
||||||
{
|
{
|
||||||
typedef typename C::iterator I;
|
|
||||||
typedef typename C::const_iterator CI;
|
typedef typename C::const_iterator CI;
|
||||||
std::size_t c1_osize = c1.size();
|
std::size_t c1_osize = c1.size();
|
||||||
CI i = c1.insert(c1.begin() + P, size, x);
|
CI i = c1.insert(c1.begin() + P, size, x);
|
||||||
@ -64,8 +64,6 @@ template <class C>
|
|||||||
void
|
void
|
||||||
testN(int start, int N, int M)
|
testN(int start, int N, int M)
|
||||||
{
|
{
|
||||||
typedef typename C::iterator I;
|
|
||||||
typedef typename C::const_iterator CI;
|
|
||||||
for (int i = 0; i <= 3; ++i)
|
for (int i = 0; i <= 3; ++i)
|
||||||
{
|
{
|
||||||
if (0 <= i && i <= N)
|
if (0 <= i && i <= N)
|
||||||
@ -145,7 +143,7 @@ int main()
|
|||||||
testN<std::deque<int> >(rng[i], rng[j], rng[k]);
|
testN<std::deque<int> >(rng[i], rng[j], rng[k]);
|
||||||
self_reference_test<std::deque<int> >();
|
self_reference_test<std::deque<int> >();
|
||||||
}
|
}
|
||||||
#if __cplusplus >= 201103L
|
#if TEST_STD_VER >= 11
|
||||||
{
|
{
|
||||||
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
|
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
|
||||||
const int N = sizeof(rng)/sizeof(rng[0]);
|
const int N = sizeof(rng)/sizeof(rng[0]);
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include <deque>
|
#include <deque>
|
||||||
#include <cassert>
|
#include <cassert>
|
||||||
|
|
||||||
|
#include "test_macros.h"
|
||||||
#include "min_allocator.h"
|
#include "min_allocator.h"
|
||||||
|
|
||||||
template <class C>
|
template <class C>
|
||||||
@ -42,7 +43,6 @@ template <class C>
|
|||||||
void
|
void
|
||||||
test(int P, C& c1, int x)
|
test(int P, C& c1, int x)
|
||||||
{
|
{
|
||||||
typedef typename C::iterator I;
|
|
||||||
typedef typename C::const_iterator CI;
|
typedef typename C::const_iterator CI;
|
||||||
std::size_t c1_osize = c1.size();
|
std::size_t c1_osize = c1.size();
|
||||||
CI i = c1.insert(c1.begin() + P, x);
|
CI i = c1.insert(c1.begin() + P, x);
|
||||||
@ -62,8 +62,6 @@ template <class C>
|
|||||||
void
|
void
|
||||||
testN(int start, int N)
|
testN(int start, int N)
|
||||||
{
|
{
|
||||||
typedef typename C::iterator I;
|
|
||||||
typedef typename C::const_iterator CI;
|
|
||||||
for (int i = 0; i <= 3; ++i)
|
for (int i = 0; i <= 3; ++i)
|
||||||
{
|
{
|
||||||
if (0 <= i && i <= N)
|
if (0 <= i && i <= N)
|
||||||
@ -126,7 +124,7 @@ int main()
|
|||||||
testN<std::deque<int> >(rng[i], rng[j]);
|
testN<std::deque<int> >(rng[i], rng[j]);
|
||||||
self_reference_test<std::deque<int> >();
|
self_reference_test<std::deque<int> >();
|
||||||
}
|
}
|
||||||
#if __cplusplus >= 201103L
|
#if TEST_STD_VER >= 11
|
||||||
{
|
{
|
||||||
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
|
int rng[] = {0, 1, 2, 3, 1023, 1024, 1025, 2047, 2048, 2049};
|
||||||
const int N = sizeof(rng)/sizeof(rng[0]);
|
const int N = sizeof(rng)/sizeof(rng[0]);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user