-// { dg-do compile { target c++23 } }
+// { dg-do run { target c++23 } }
#include <vector>
#include <span>
bool val;
};
using rvalue_input_range = test_range<C, input_iterator_wrapper_rval>;
- do_test_a<rvalue_input_range>();
+ do_test<rvalue_input_range>(std::allocator<int>());
return true;
}
test_constexpr()
{
// XXX: this doesn't test the non-forward_range code paths are constexpr.
- do_test<std::span<bool>, std::allocator<bool>>;
+ do_test<std::span<bool>>(std::allocator<bool>());
return true;
}
-// { dg-do compile { target c++23 } }
+// { dg-do run { target c++23 } }
#include <vector>
#include <span>
return true;
};
- Range r4(a, a+4);
- Range r9(a);
-
+ // assign to empty vector
std::vector<bool, Alloc> v;
v.assign_range(Range(a, a));
VERIFY( v.empty() );
VERIFY( v.capacity() == 0 );
- v.assign_range(r4);
+ v.assign_range(Range(a, a+4));
VERIFY( eq(v, {a, 4}) );
v.clear();
- v.assign_range(r9); // larger than v.capacity()
+ v.assign_range(Range(a)); // larger than v.capacity()
VERIFY( eq(v, a) );
- v.assign_range(r9); // equal to size() and equal to capacity()
+ v.clear();
+ v.assign_range(Range(a, a+4)); // smaller than v.capacity()
+ VERIFY( eq(v, {a, 4}) );
+ v.clear();
+ v.assign_range(Range(a)); // equal to v.capacity()
+ VERIFY( eq(v, a) );
+
+ // assign to non-empty vector
+ v.assign_range(Range(a, a+4)); // smaller than size()
+ VERIFY( eq(v, {a, 4}) );
+ v.assign_range(Range(a)); // larger than size(), equal to capacity()
VERIFY( eq(v, a) );
v.resize(1);
- v.assign_range(r4); // larger than size(), smaller than capacity()
+ v.assign_range(Range(a, a+4)); // larger than size(), smaller than capacity()
VERIFY( eq(v, {a, 4}) );
v.clear();
v.resize(4);
- v.assign_range(r4); // equal to size(), smaller than capacity()
+ v.assign_range(Range(a, a+4)); // equal to size(), smaller than capacity()
VERIFY( eq(v, {a, 4}) );
v.shrink_to_fit();
- v.assign_range(r9); // larger than capacity()
+ v.assign_range(Range(a)); // larger than capacity()
VERIFY( eq(v, a) );
v.assign_range(Range(a, a));
VERIFY( v.empty() );
test_constexpr()
{
// XXX: this doesn't test the non-forward_range code paths are constexpr.
- do_test<std::span<short>, std::allocator<bool>>;
+ do_test<std::span<short>, std::allocator<bool>>();
return true;
}
-// { dg-do compile { target c++23 } }
+// { dg-do run { target c++23 } }
#include <vector>
#include <span>
bool val;
};
using rvalue_input_range = test_range<C, input_iterator_wrapper_rval>;
- do_test_a<rvalue_input_range>();
+ do_test<rvalue_input_range, std::allocator<bool>>();
return true;
}
test_constexpr()
{
// XXX: this doesn't test the non-forward_range code paths are constexpr.
- do_test<std::span<short>, std::allocator<bool>>;
+ do_test<std::span<short>, std::allocator<bool>>();
return true;
}
-// { dg-do compile { target c++23 } }
+// { dg-do run { target c++23 } }
#include <vector>
#include <span>
v.insert_range(v.begin(), Range(a, a+4));
VERIFY( eq(v, {a, a+4}) );
v.clear();
- v.insert_range(v.begin(), Range(a, a+5));
+ v.insert_range(v.begin(), Range(a+4, a+9));
VERIFY( eq(v, {a+4, a+9}) );
v.insert_range(v.begin(), Range(a, a+4));
VERIFY( eq(v, a) );
VERIFY( eq(v, a) );
v.resize(3);
v.insert_range(v.begin()+1, Range(a+4, a+9));
- v.insert_range(v.begin()+1, Range(a+1, a+3));
+ v.insert_range(v.begin()+1, Range(a+1, a+4));
v.resize(9);
VERIFY( eq(v, a) );
v.insert_range(v.begin(), Range(a, a));
bool val;
};
using rvalue_input_range = test_range<C, input_iterator_wrapper_rval>;
- do_test_a<rvalue_input_range>();
+ do_test<rvalue_input_range, std::allocator<bool>>();
return true;
}
test_constexpr()
{
// XXX: this doesn't test the non-forward_range code paths are constexpr.
- do_test<std::span<bool>, std::allocator<bool>>;
+ do_test<std::span<bool>, std::allocator<bool>>();
return true;
}
-// { dg-do compile { target c++23 } }
+// { dg-do run { target c++23 } }
#include <vector>
#include <span>
int val;
};
using rvalue_input_range = test_range<C, input_iterator_wrapper_rval>;
- do_test<rvalue_input_range, std::allocator<int>>();
+ do_test<rvalue_input_range>(std::allocator<int>());
return true;
}
test_constexpr()
{
// XXX: this doesn't test the non-forward_range code paths are constexpr.
- do_test<std::span<short>, std::allocator<int>>;
+ do_test<std::span<short>>(std::allocator<int>());
return true;
}
-// { dg-do compile { target c++23 } }
+// { dg-do run { target c++23 } }
#include <vector>
#include <span>
test_constexpr()
{
// XXX: this doesn't test the non-forward_range code paths are constexpr.
- do_test<std::span<short>, std::allocator<int>>;
+ do_test<std::span<short>, std::allocator<int>>();
return true;
}
-// { dg-do compile { target c++23 } }
+// { dg-do run { target c++23 } }
#include <vector>
#include <span>
return true;
};
- Range r4(a, a+4);
- Range r9(a);
-
// assign to empty vector
std::vector<V, Alloc> v;
v.assign_range(Range(a, a));
VERIFY( v.empty() );
VERIFY( v.capacity() == 0 );
- v.assign_range(r4);
+ v.assign_range(Range(a, a+4));
VERIFY( eq(v, {a, 4}) );
v.clear();
- v.assign_range(r9); // larger than v.capacity()
+ v.assign_range(Range(a)); // larger than v.capacity()
VERIFY( eq(v, a) );
v.clear();
- v.assign_range(r4); // smaller than v.capacity()
+ v.assign_range(Range(a, a+4)); // smaller than v.capacity()
VERIFY( eq(v, {a, 4}) );
v.clear();
- v.assign_range(r9); // equal to v.capacity()
+ v.assign_range(Range(a)); // equal to v.capacity()
VERIFY( eq(v, a) );
// assign to non-empty vector
- v.assign_range(r4); // smaller than size()
+ v.assign_range(Range(a, a+4)); // smaller than size()
VERIFY( eq(v, {a, 4}) );
- v.assign_range(r9); // larger than size(), equal to capacity()
+ v.assign_range(Range(a)); // larger than size(), equal to capacity()
VERIFY( eq(v, a) );
v.resize(1);
- v.assign_range(r4); // larger than size(), smaller than capacity()
+ v.assign_range(Range(a, a+4)); // larger than size(), smaller than capacity()
VERIFY( eq(v, {a, 4}) );
v.clear();
v.resize(4);
- v.assign_range(r4); // equal to size(), smaller than capacity()
+ v.assign_range(Range(a, a+4)); // equal to size(), smaller than capacity()
VERIFY( eq(v, {a, 4}) );
v.shrink_to_fit();
- v.assign_range(r9); // larger than capacity()
+ v.assign_range(Range(a)); // larger than capacity()
VERIFY( eq(v, a) );
v.assign_range(Range(a, a));
VERIFY( v.empty() );
test_constexpr()
{
// XXX: this doesn't test the non-forward_range code paths are constexpr.
- do_test<std::span<short>, std::allocator<int>>;
+ do_test<std::span<short>, std::allocator<int>>();
return true;
}
-// { dg-do compile { target c++23 } }
+// { dg-do run { target c++23 } }
#include <vector>
#include <span>
v.insert_range(v.begin(), Range(a, a+4));
VERIFY( eq(v, {a, a+4}) );
v.clear();
- v.insert_range(v.begin(), Range(a, a+5));
+ v.insert_range(v.begin(), Range(a+4, a+9));
VERIFY( eq(v, {a+4, a+9}) );
v.insert_range(v.begin(), Range(a, a+4));
VERIFY( eq(v, a) );
VERIFY( eq(v, a) );
v.resize(3);
v.insert_range(v.begin()+1, Range(a+4, a+9));
- v.insert_range(v.begin()+1, Range(a+1, a+3));
+ v.insert_range(v.begin()+1, Range(a+1, a+4));
v.resize(9);
VERIFY( eq(v, a) );
v.insert_range(v.begin() + 6, Range(a, a));
test_constexpr()
{
// XXX: this doesn't test the non-forward_range code paths are constexpr.
- do_test<std::span<short>, std::allocator<int>>;
+ do_test<std::span<short>, std::allocator<int>>();
return true;
}