Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@


template <typename Span>
constexpr bool testConstexprSpan(Span sp, size_t idx)
constexpr bool testConstexprSpan(Span sp, std::size_t idx)
{
LIBCPP_ASSERT(noexcept(sp[idx]));

Expand All @@ -32,7 +32,7 @@ constexpr bool testConstexprSpan(Span sp, size_t idx)


template <typename Span>
void testRuntimeSpan(Span sp, size_t idx)
void testRuntimeSpan(Span sp, std::size_t idx)
{
LIBCPP_ASSERT(noexcept(sp[idx]));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ constexpr bool testConstexprSpan(Span s)
ret = ret && (&*( e-1) == last);
}

ret = ret && (static_cast<size_t>(e - s.begin()) == s.size());
ret = ret && (static_cast<std::size_t>(e - s.begin()) == s.size());
return ret;
}

Expand All @@ -53,7 +53,7 @@ void testRuntimeSpan(Span s)
assert(&*( e-1) == last);
}

assert(static_cast<size_t>(e - s.begin()) == s.size());
assert(static_cast<std::size_t>(e - s.begin()) == s.size());
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ constexpr bool testConstexprSpan(Span s)
ret = ret && (e != s.rbegin());
}

ret = ret && (static_cast<size_t>(e - s.rbegin()) == s.size());
ret = ret && (static_cast<std::size_t>(e - s.rbegin()) == s.size());
return ret;
}

Expand All @@ -49,7 +49,7 @@ void testRuntimeSpan(Span s)
assert(e != s.rbegin());
}

assert(static_cast<size_t>(e - s.rbegin()) == s.size());
assert(static_cast<std::size_t>(e - s.rbegin()) == s.size());
}


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ void f() {
std::as_writable_bytes(std::span<const long, 0>()); // expected-error {{no matching function for call to 'as_writable_bytes'}}
std::as_writable_bytes(std::span<const double, 0>()); // expected-error {{no matching function for call to 'as_writable_bytes'}}
std::as_writable_bytes(std::span<const A, 0>()); // expected-error {{no matching function for call to 'as_writable_bytes'}}
std::as_writable_bytes(std::span<const std::string, (size_t)0>()); // expected-error {{no matching function for call to 'as_writable_bytes'}}
std::as_writable_bytes(std::span<const std::string, (std::size_t)0>()); // expected-error {{no matching function for call to 'as_writable_bytes'}}

std::as_writable_bytes(std::span<const int> (iArr2, 1)); // expected-error {{no matching function for call to 'as_writable_bytes'}}
std::as_writable_bytes(std::span<const int, 1>(iArr2 + 5, 1)); // expected-error {{no matching function for call to 'as_writable_bytes'}}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@


template <typename Span>
constexpr bool testConstexprSpan(Span sp, size_t sz)
constexpr bool testConstexprSpan(Span sp, std::size_t sz)
{
ASSERT_NOEXCEPT(sp.size());
return sp.size() == sz;
}


template <typename Span>
void testRuntimeSpan(Span sp, size_t sz)
void testRuntimeSpan(Span sp, std::size_t sz)
{
ASSERT_NOEXCEPT(sp.size());
assert(sp.size() == sz);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,18 +22,18 @@


template <typename Span>
constexpr bool testConstexprSpan(Span sp, size_t sz)
constexpr bool testConstexprSpan(Span sp, std::size_t sz)
{
ASSERT_NOEXCEPT(sp.size_bytes());
return (size_t) sp.size_bytes() == sz * sizeof(typename Span::element_type);
return (std::size_t) sp.size_bytes() == sz * sizeof(typename Span::element_type);
}


template <typename Span>
void testRuntimeSpan(Span sp, size_t sz)
void testRuntimeSpan(Span sp, std::size_t sz)
{
ASSERT_NOEXCEPT(sp.size_bytes());
assert((size_t) sp.size_bytes() == sz * sizeof(typename Span::element_type));
assert((std::size_t) sp.size_bytes() == sz * sizeof(typename Span::element_type));
}

struct A{};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include "test_macros.h"

template <typename Span, size_t Count>
template <typename Span, std::size_t Count>
constexpr bool testConstexprSpan(Span sp)
{
LIBCPP_ASSERT((noexcept(sp.template first<Count>())));
Expand All @@ -43,7 +43,7 @@ constexpr bool testConstexprSpan(Span sp)
}


template <typename Span, size_t Count>
template <typename Span, std::size_t Count>
void testRuntimeSpan(Span sp)
{
LIBCPP_ASSERT((noexcept(sp.template first<Count>())));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include "test_macros.h"

template <typename Span, size_t Count>
template <typename Span, std::size_t Count>
constexpr bool testConstexprSpan(Span sp)
{
LIBCPP_ASSERT((noexcept(sp.template last<Count>())));
Expand All @@ -43,7 +43,7 @@ constexpr bool testConstexprSpan(Span sp)
}


template <typename Span, size_t Count>
template <typename Span, std::size_t Count>
void testRuntimeSpan(Span sp)
{
LIBCPP_ASSERT((noexcept(sp.template last<Count>())));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

#include "test_macros.h"

template <typename Span, size_t Offset, size_t Count>
template <typename Span, std::size_t Offset, size_t Count>
constexpr bool testConstexprSpan(Span sp)
{
LIBCPP_ASSERT((noexcept(sp.template subspan<Offset, Count>())));
Expand All @@ -43,7 +43,7 @@ constexpr bool testConstexprSpan(Span sp)
&& std::equal(s1.begin(), s1.end(), sp.begin() + Offset);
}

template <typename Span, size_t Offset>
template <typename Span, std::size_t Offset>
constexpr bool testConstexprSpan(Span sp)
{
LIBCPP_ASSERT((noexcept(sp.template subspan<Offset>())));
Expand All @@ -63,7 +63,7 @@ constexpr bool testConstexprSpan(Span sp)
}


template <typename Span, size_t Offset, size_t Count>
template <typename Span, std::size_t Offset, size_t Count>
void testRuntimeSpan(Span sp)
{
LIBCPP_ASSERT((noexcept(sp.template subspan<Offset, Count>())));
Expand All @@ -82,7 +82,7 @@ void testRuntimeSpan(Span sp)
}


template <typename Span, size_t Offset>
template <typename Span, std::size_t Offset>
void testRuntimeSpan(Span sp)
{
LIBCPP_ASSERT((noexcept(sp.template subspan<Offset>())));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ void my_free(void*)
struct test
: std::strstreambuf
{
test(void* (*palloc_arg)(size_t), void (*pfree_arg)(void*))
test(void* (*palloc_arg)(std::size_t), void (*pfree_arg)(void*))
: std::strstreambuf(palloc_arg, pfree_arg) {}
virtual int_type overflow(int_type c)
{return std::strstreambuf::overflow(c);}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

namespace ex = std::experimental::pmr;

template <size_t S, size_t Align>
template <std::size_t S, size_t Align>
void testForSizeAndAlign() {
struct T { alignas(Align) char data[S]; };
TestResource R;
Expand All @@ -52,7 +52,7 @@ void testForSizeAndAlign() {
}

#ifndef TEST_HAS_NO_EXCEPTIONS
template <size_t S>
template <std::size_t S>
void testAllocForSizeThrows() {
struct T { char data[S]; };
using Alloc = ex::polymorphic_allocator<T>;
Expand All @@ -61,14 +61,14 @@ void testAllocForSizeThrows() {
Alloc a(&R);

// Test that allocating exactly the max size does not throw.
size_t maxSize = Traits::max_size(a);
std::size_t maxSize = Traits::max_size(a);
try {
a.allocate(maxSize);
} catch (...) {
assert(false);
}

size_t sizeTypeMax = std::numeric_limits<std::size_t>::max();
std::size_t sizeTypeMax = std::numeric_limits<std::size_t>::max();
if (maxSize != sizeTypeMax)
{
// Test that allocating size_t(~0) throws bad_array_new_length.
Expand All @@ -79,7 +79,7 @@ void testAllocForSizeThrows() {
}

// Test that allocating even one more than the max size does throw.
size_t overSize = maxSize + 1;
std::size_t overSize = maxSize + 1;
try {
a.allocate(overSize);
assert(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

namespace ex = std::experimental::pmr;

template <size_t S, size_t Align>
template <std::size_t S, size_t Align>
void testForSizeAndAlign() {
struct T { alignas(Align) char data[S]; };

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ namespace ex = std::experimental::pmr;
struct assert_on_compare : public ex::memory_resource
{
protected:
void * do_allocate(size_t, size_t) override
void * do_allocate(std::size_t, size_t) override
{ assert(false); return nullptr; }

void do_deallocate(void *, size_t, size_t) override
void do_deallocate(void *, std::size_t, size_t) override
{ assert(false); }

bool do_is_equal(ex::memory_resource const &) const noexcept override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ namespace ex = std::experimental::pmr;
struct assert_on_compare : public ex::memory_resource
{
protected:
void * do_allocate(size_t, size_t) override
void * do_allocate(std::size_t, size_t) override
{ assert(false); return nullptr; }

void do_deallocate(void *, size_t, size_t) override
void do_deallocate(void *, std::size_t, size_t) override
{ assert(false); }

bool do_is_equal(ex::memory_resource const &) const noexcept override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void compile_unsigned() {
template <typename SimdType>
void test_broadcast() {
SimdType a(3);
for (size_t i = 0; i < a.size(); i++) {
for (std::size_t i = 0; i < a.size(); i++) {
assert(a[i] == 3);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ template <class T>
void supported_simd128_ctor(...) = delete;

struct identity {
template <size_t value>
int operator()(std::integral_constant<size_t, value>) const {
template <std::size_t value>
int operator()(std::integral_constant<std::size_t, value>) const {
return value;
}
};
Expand All @@ -52,9 +52,9 @@ void compile_generator() {
}

struct limited_identity {
template <size_t value>
template <std::size_t value>
typename std::conditional<value <= 2, std::int32_t, std::int64_t>::type
operator()(std::integral_constant<size_t, value>) const {
operator()(std::integral_constant<std::size_t, value>) const {
return value;
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ template <> struct hash<X>
{
typedef X first_argument_type;

size_t operator()(const first_argument_type&) const
std::size_t operator()(const first_argument_type&) const
{
return 99;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,15 +131,15 @@ void test_compare_basic()
auto h2 = hash_value(p2);
assert((h1 == h2) == (p1 == p2));
// check signature
ASSERT_SAME_TYPE(size_t, decltype(hash_value(p1)));
ASSERT_SAME_TYPE(std::size_t, decltype(hash_value(p1)));
ASSERT_NOEXCEPT(hash_value(p1));
}
{ // check std::hash
auto h1 = std::hash<fs::path>()(p1);
auto h2 = std::hash<fs::path>()(p2);
assert((h1 == h2) == (p1 == p2));
// check signature
ASSERT_SAME_TYPE(size_t, decltype(std::hash<fs::path>()(p1)));
ASSERT_SAME_TYPE(std::size_t, decltype(std::hash<fs::path>()(p1)));
ASSERT_NOEXCEPT(std::hash<fs::path>()(p1));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void test_hex(const char *expected)
ss << std::hex << static_cast<T>(-1);

std::string str = ss.str();
for (size_t i = 0; i < str.size(); ++i )
for (std::size_t i = 0; i < str.size(); ++i )
str[i] = static_cast<char>(std::toupper(str[i]));

assert(str == expected);
Expand Down
2 changes: 1 addition & 1 deletion libcxx/test/std/iterators/iterator.container/data.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void test_container( std::initializer_list<T>& c)
assert ( std::data(c) == c.begin());
}

template<typename T, size_t Sz>
template<typename T, std::size_t Sz>
void test_const_array( const T (&array)[Sz] )
{
ASSERT_NOEXCEPT(std::data(array));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ void test_container( std::initializer_list<T>& c )
assert ( std::empty(c) == (c.size() == 0));
}

template<typename T, size_t Sz>
template<typename T, std::size_t Sz>
void test_const_array( const T (&array)[Sz] )
{
ASSERT_NOEXCEPT(std::empty(array));
Expand Down
2 changes: 1 addition & 1 deletion libcxx/test/std/iterators/iterator.container/size.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ void test_container( std::initializer_list<T>& c )
assert ( std::size(c) == c.size());
}

template<typename T, size_t Sz>
template<typename T, std::size_t Sz>
void test_const_array( const T (&array)[Sz] )
{
ASSERT_NOEXCEPT(std::size(array));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ void test_container(std::initializer_list<T>& c)
assert ( std::ssize(c) == static_cast<decltype(std::ssize(c))>(c.size()));
}

template<typename T, size_t Sz>
template<typename T, std::size_t Sz>
void test_const_array(const T (&array)[Sz])
{
ASSERT_NOEXCEPT(std::ssize(array));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@

template <class C>
void do_test(int *LHSVal, int *RHSVal) {
[[maybe_unused]] const size_t ExpectLHS = std::hash<void*>{}(LHSVal);
[[maybe_unused]] const size_t ExpectRHS = std::hash<void*>{}(RHSVal);
[[maybe_unused]] const std::size_t ExpectLHS = std::hash<void*>{}(LHSVal);
[[maybe_unused]] const std::size_t ExpectRHS = std::hash<void*>{}(RHSVal);
const C LHS = C::from_address(LHSVal);
const C RHS = C::from_address(RHSVal);
const std::hash<C> h;
Expand All @@ -40,7 +40,7 @@ void do_test(int *LHSVal, int *RHSVal) {
LIBCPP_ASSERT(h(RHS) == ExpectRHS);
assert((h(LHS) == h(RHS)) == (LHSVal == RHSVal));
{
ASSERT_SAME_TYPE(decltype(h(LHS)), size_t);
ASSERT_SAME_TYPE(decltype(h(LHS)), std::size_t);
ASSERT_NOEXCEPT(std::hash<C>{}(LHS));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void test_abs() {
static_assert(!has_abs<unsigned>::value, "");
static_assert(!has_abs<unsigned long>::value, "");
static_assert(!has_abs<unsigned long long>::value, "");
static_assert(!has_abs<size_t>::value, "");
static_assert(!has_abs<std::size_t>::value, "");

TEST_DIAGNOSTIC_POP

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ int main(int, char**)
typedef F::mask mask;
const mask *p = F::classic_table();

for ( size_t i = 0; i < 128; ++i ) // values above 128 are not consistent
for ( std::size_t i = 0; i < 128; ++i ) // values above 128 are not consistent
{

bool expect_cntrl = (i < 32 || 126 < i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

int main(int, char**) {
typedef std::ctype<char> F;
const size_t* G = &F::table_size;
const std::size_t* G = &F::table_size;
assert(*G >= 256);

return 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ void test_negate() {
++value;
std::string std_str = make_neg_string(value);
const char* str = std_str.data();
size_t size = std_str.size();
std::size_t size = std_str.size();
std::ios_base::iostate err = ios.goodbit;
cpp17_input_iterator<const char*> iter =
f.get(cpp17_input_iterator<const char*>(str),
Expand All @@ -102,7 +102,7 @@ void test_negate() {
++value;
std::string std_str = make_neg_string(value);
const char* str = std_str.data();
size_t size = std_str.size();
std::size_t size = std_str.size();
std::ios_base::iostate err = ios.goodbit;
cpp17_input_iterator<const char*> iter =
f.get(cpp17_input_iterator<const char*>(str),
Expand All @@ -118,7 +118,7 @@ void test_negate() {
T value = std::numeric_limits<T>::max();
std::string std_str = make_neg_string(value);
const char* str = std_str.data();
size_t size = std_str.size();
std::size_t size = std_str.size();
std::ios_base::iostate err = ios.goodbit;
cpp17_input_iterator<const char*> iter =
f.get(cpp17_input_iterator<const char*>(str),
Expand All @@ -134,7 +134,7 @@ void test_negate() {
std::string std_str = make_neg_string(std::numeric_limits<T>::max());
std_str.back()++;
const char* str = std_str.data();
size_t size = std_str.size();
std::size_t size = std_str.size();
std::ios_base::iostate err = ios.goodbit;
cpp17_input_iterator<const char*> iter =
f.get(cpp17_input_iterator<const char*>(str),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "test_macros.h"

template <class CharT, size_t = sizeof(CharT)>
template <class CharT, std::size_t = sizeof(CharT)>
struct TestHelper;

template <class CharT>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#include "test_macros.h"

template <class CharT, size_t = sizeof(CharT)>
template <class CharT, std::size_t = sizeof(CharT)>
struct TestHelper;

template <class CharT>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "test_macros.h"

template <class CharT, size_t = sizeof(CharT)>
template <class CharT, std::size_t = sizeof(CharT)>
struct TestHelper;
template <class CharT>
struct TestHelper<CharT, 2> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include "test_macros.h"

template <class CharT, size_t = sizeof(CharT)>
template <class CharT, std::size_t = sizeof(CharT)>
struct TestHelper;

template <class CharT>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#include "test_macros.h"

template <class CharT, size_t = sizeof(CharT)>
template <class CharT, std::size_t = sizeof(CharT)>
struct TestHelper;

template <class CharT>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "test_macros.h"

template <class CharT, size_t = sizeof(CharT)>
template <class CharT, std::size_t = sizeof(CharT)>
struct TestHelper;

template <class CharT>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "test_macros.h"

template <class CharT, size_t = sizeof(CharT)>
template <class CharT, std::size_t = sizeof(CharT)>
struct TestHelper;
template <class CharT>
struct TestHelper<CharT, 2> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@

#include "test_macros.h"

template <class CharT, size_t = sizeof(CharT)>
template <class CharT, std::size_t = sizeof(CharT)>
struct TestHelper;
template <class CharT>
struct TestHelper<CharT, 2> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include "test_macros.h"

template <class CharT, size_t = sizeof(CharT)>
template <class CharT, std::size_t = sizeof(CharT)>
struct TestHelper;
template <class CharT>
struct TestHelper<CharT, 2> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#include "test_macros.h"

template <class CharT, size_t = sizeof(CharT)>
template <class CharT, std::size_t = sizeof(CharT)>
struct TestHelper;
template <class CharT>
struct TestHelper<CharT, 2> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

#include "test_macros.h"

template <class CharT, size_t = sizeof(CharT)>
template <class CharT, std::size_t = sizeof(CharT)>
struct TestHelper;
template <class CharT>
struct TestHelper<CharT, 2> {
Expand Down
2 changes: 1 addition & 1 deletion libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.fail.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ int main(int, char**)
static_assert(toobig<std::uint16_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
static_assert(toobig<std::uint32_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
static_assert(toobig<std::uint64_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
static_assert(toobig<size_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
static_assert(toobig<std::size_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
static_assert(toobig<uintmax_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}
static_assert(toobig<uintptr_t>(), ""); // expected-error-re {{{{(static_assert|static assertion)}} expression is not an integral constant expression}}

Expand Down
4 changes: 2 additions & 2 deletions libcxx/test/std/numerics/bit/bit.pow.two/bit_ceil.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ int main(int, char**)
static_assert(test<std::uint64_t>());
static_assert(test<uintmax_t>());
static_assert(test<uintptr_t>());
static_assert(test<size_t>());
static_assert(test<std::size_t>());

test<unsigned char>();
test<unsigned short>();
Expand All @@ -137,7 +137,7 @@ int main(int, char**)
test<std::uint64_t>();
test<uintmax_t>();
test<uintptr_t>();
test<size_t>();
test<std::size_t>();

return 0;
}
4 changes: 2 additions & 2 deletions libcxx/test/std/numerics/bit/bit.pow.two/bit_floor.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ int main(int, char**)
static_assert(test<std::uint64_t>());
static_assert(test<uintmax_t>());
static_assert(test<uintptr_t>());
static_assert(test<size_t>());
static_assert(test<std::size_t>());

test<unsigned char>();
test<unsigned short>();
Expand All @@ -136,7 +136,7 @@ int main(int, char**)
test<std::uint64_t>();
test<uintmax_t>();
test<uintptr_t>();
test<size_t>();
test<std::size_t>();

return 0;
}
4 changes: 2 additions & 2 deletions libcxx/test/std/numerics/bit/bit.pow.two/bit_width.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ int main(int, char**)
static_assert(test<std::uint64_t>());
static_assert(test<uintmax_t>());
static_assert(test<uintptr_t>());
static_assert(test<size_t>());
static_assert(test<std::size_t>());

test<unsigned char>();
test<unsigned short>();
Expand All @@ -139,7 +139,7 @@ int main(int, char**)
test<std::uint64_t>();
test<uintmax_t>();
test<uintptr_t>();
test<size_t>();
test<std::size_t>();

return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ int main(int, char**)
static_assert(test<std::uint64_t>());
static_assert(test<uintmax_t>());
static_assert(test<uintptr_t>());
static_assert(test<size_t>());
static_assert(test<std::size_t>());

test<unsigned char>();
test<unsigned short>();
Expand All @@ -137,7 +137,7 @@ int main(int, char**)
test<std::uint64_t>();
test<uintmax_t>();
test<uintptr_t>();
test<size_t>();
test<std::size_t>();

return 0;
}
4 changes: 2 additions & 2 deletions libcxx/test/std/numerics/bit/bitops.count/countl_one.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ int main(int, char**)
static_assert(test<std::uint64_t>());
static_assert(test<uintmax_t>());
static_assert(test<uintptr_t>());
static_assert(test<size_t>());
static_assert(test<std::size_t>());

test<unsigned char>();
test<unsigned short>();
Expand All @@ -134,7 +134,7 @@ int main(int, char**)
test<std::uint64_t>();
test<uintmax_t>();
test<uintptr_t>();
test<size_t>();
test<std::size_t>();

return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ int main(int, char**)
static_assert(test<std::uint64_t>());
static_assert(test<uintmax_t>());
static_assert(test<uintptr_t>());
static_assert(test<size_t>());
static_assert(test<std::size_t>());

test<unsigned char>();
test<unsigned short>();
Expand All @@ -133,7 +133,7 @@ int main(int, char**)
test<std::uint64_t>();
test<uintmax_t>();
test<uintptr_t>();
test<size_t>();
test<std::size_t>();

return 0;
}
4 changes: 2 additions & 2 deletions libcxx/test/std/numerics/bit/bitops.count/countr_one.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ int main(int, char**)
static_assert(test<std::uint64_t>());
static_assert(test<uintmax_t>());
static_assert(test<uintptr_t>());
static_assert(test<size_t>());
static_assert(test<std::size_t>());

test<unsigned char>();
test<unsigned short>();
Expand All @@ -138,7 +138,7 @@ int main(int, char**)
test<std::uint64_t>();
test<uintmax_t>();
test<uintptr_t>();
test<size_t>();
test<std::size_t>();

return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ int main(int, char**)
static_assert(test<std::uint64_t>());
static_assert(test<uintmax_t>());
static_assert(test<uintptr_t>());
static_assert(test<size_t>());
static_assert(test<std::size_t>());

test<unsigned char>();
test<unsigned short>();
Expand All @@ -135,7 +135,7 @@ int main(int, char**)
test<std::uint64_t>();
test<uintmax_t>();
test<uintptr_t>();
test<size_t>();
test<std::size_t>();

return 0;
}
4 changes: 2 additions & 2 deletions libcxx/test/std/numerics/bit/bitops.count/popcount.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ int main(int, char**)
static_assert(test<std::uint64_t>());
static_assert(test<uintmax_t>());
static_assert(test<uintptr_t>());
static_assert(test<size_t>());
static_assert(test<std::size_t>());

test<unsigned char>();
test<unsigned short>();
Expand All @@ -145,7 +145,7 @@ int main(int, char**)
test<std::uint64_t>();
test<uintmax_t>();
test<uintptr_t>();
test<size_t>();
test<std::size_t>();

return 0;
}
4 changes: 2 additions & 2 deletions libcxx/test/std/numerics/bit/bitops.rot/rotl.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ int main(int, char**)
static_assert(test<std::uint64_t>());
static_assert(test<uintmax_t>());
static_assert(test<uintptr_t>());
static_assert(test<size_t>());
static_assert(test<std::size_t>());

test<unsigned char>();
test<unsigned short>();
Expand All @@ -135,7 +135,7 @@ int main(int, char**)
test<std::uint64_t>();
test<uintmax_t>();
test<uintptr_t>();
test<size_t>();
test<std::size_t>();

return 0;
}
4 changes: 2 additions & 2 deletions libcxx/test/std/numerics/bit/bitops.rot/rotr.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ int main(int, char**)
static_assert(test<std::uint64_t>());
static_assert(test<uintmax_t>());
static_assert(test<uintptr_t>());
static_assert(test<size_t>());
static_assert(test<std::size_t>());

test<unsigned char>();
test<unsigned short>();
Expand All @@ -136,7 +136,7 @@ int main(int, char**)
test<std::uint64_t>();
test<uintmax_t>();
test<uintptr_t>();
test<size_t>();
test<std::size_t>();

return 0;
}
2 changes: 1 addition & 1 deletion libcxx/test/std/numerics/c.math/cmath.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ void test_abs()
static_assert(!has_abs<unsigned>::value, "");
static_assert(!has_abs<unsigned long>::value, "");
static_assert(!has_abs<unsigned long long>::value, "");
static_assert(!has_abs<size_t>::value, "");
static_assert(!has_abs<std::size_t>::value, "");

TEST_DIAGNOSTIC_POP

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ int main(int, char**)
{
// From (indirect_array<T>)
std::valarray<long> v = {1, 2, 3, 4, 5};
std::valarray<size_t> i = {1, 2, 3};
std::valarray<std::size_t> i = {1, 2, 3};
std::valarray v2 = v[i];
static_assert(std::is_same_v<decltype(v2), std::valarray<long>>);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct S {
S() : x(1) {}
~S() { ++cnt_dtor; }
int x;
static size_t cnt_dtor;
static std::size_t cnt_dtor;
};

size_t S::cnt_dtor = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,33 +57,33 @@ test()
}
}

constexpr size_t triangle(size_t n) { return n*(n+1)/2; }
constexpr std::size_t triangle(size_t n) { return n*(n+1)/2; }

// Basic sanity
TEST_CONSTEXPR_CXX20 void
basic_tests()
{
{
std::array<size_t, 10> v;
std::array<std::size_t, 10> v;
std::fill(v.begin(), v.end(), 3);
std::exclusive_scan(v.begin(), v.end(), v.begin(), size_t{50});
for (size_t i = 0; i < v.size(); ++i)
std::exclusive_scan(v.begin(), v.end(), v.begin(), std::size_t{50});
for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 50 + i * 3);
}

{
std::array<size_t, 10> v;
std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 0);
std::exclusive_scan(v.begin(), v.end(), v.begin(), size_t{30});
for (size_t i = 0; i < v.size(); ++i)
std::exclusive_scan(v.begin(), v.end(), v.begin(), std::size_t{30});
for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 30 + triangle(i-1));
}

{
std::array<size_t, 10> v;
std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 1);
std::exclusive_scan(v.begin(), v.end(), v.begin(), size_t{40});
for (size_t i = 0; i < v.size(); ++i)
std::exclusive_scan(v.begin(), v.end(), v.begin(), std::size_t{40});
for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 40 + triangle(i));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,13 +77,13 @@ test()
{
std::array<unsigned char, 10> v;
std::iota(v.begin(), v.end(), static_cast<unsigned char>(1));
std::array<size_t, 10> res;
std::array<std::size_t, 10> res;
std::exclusive_scan(v.begin(), v.end(), res.begin(), 1, std::multiplies<>());

assert(res.size() == 10);
size_t j = 1;
std::size_t j = 1;
assert(res[0] == 1);
for (size_t i = 1; i < v.size(); ++i)
for (std::size_t i = 1; i < v.size(); ++i)
{
j *= i;
assert(res[i] == j);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,38 +58,38 @@ test()
}
}

constexpr size_t triangle(size_t n) { return n*(n+1)/2; }
constexpr std::size_t triangle(size_t n) { return n*(n+1)/2; }

// Basic sanity
TEST_CONSTEXPR_CXX20 void
basic_tests()
{
{
std::array<size_t, 10> v;
std::array<std::size_t, 10> v;
std::fill(v.begin(), v.end(), 3);
std::inclusive_scan(v.begin(), v.end(), v.begin());
for (size_t i = 0; i < v.size(); ++i)
for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == (i+1) * 3);
}

{
std::array<size_t, 10> v;
std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 0);
std::inclusive_scan(v.begin(), v.end(), v.begin());
for (size_t i = 0; i < v.size(); ++i)
for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == triangle(i));
}

{
std::array<size_t, 10> v;
std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 1);
std::inclusive_scan(v.begin(), v.end(), v.begin());
for (size_t i = 0; i < v.size(); ++i)
for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == triangle(i + 1));
}

{
std::array<size_t, 0> v, res;
std::array<std::size_t, 0> v, res;
std::inclusive_scan(v.begin(), v.end(), res.begin());
assert(res.empty());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,38 +62,38 @@ test()
}
}

constexpr size_t triangle(size_t n) { return n*(n+1)/2; }
constexpr std::size_t triangle(size_t n) { return n*(n+1)/2; }

// Basic sanity
TEST_CONSTEXPR_CXX20 void
basic_tests()
{
{
std::array<size_t, 10> v;
std::array<std::size_t, 10> v;
std::fill(v.begin(), v.end(), 3);
std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>());
for (size_t i = 0; i < v.size(); ++i)
for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == (i+1) * 3);
}

{
std::array<size_t, 10> v;
std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 0);
std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>());
for (size_t i = 0; i < v.size(); ++i)
for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == triangle(i));
}

{
std::array<size_t, 10> v;
std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 1);
std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>());
for (size_t i = 0; i < v.size(); ++i)
for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == triangle(i + 1));
}

{
std::array<size_t, 0> v, res;
std::array<std::size_t, 0> v, res;
std::inclusive_scan(v.begin(), v.end(), res.begin(), std::plus<>());
assert(res.empty());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,53 +62,53 @@ test()
}
}

constexpr size_t triangle(size_t n) { return n*(n+1)/2; }
constexpr std::size_t triangle(size_t n) { return n*(n+1)/2; }

// Basic sanity
TEST_CONSTEXPR_CXX20 void
basic_tests()
{
{
std::array<size_t, 10> v;
std::array<std::size_t, 10> v;
std::fill(v.begin(), v.end(), 3);
std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), size_t{50});
for (size_t i = 0; i < v.size(); ++i)
std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), std::size_t{50});
for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 50 + (i+1) * 3);
}

{
std::array<size_t, 10> v;
std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 0);
std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), size_t{40});
for (size_t i = 0; i < v.size(); ++i)
std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), std::size_t{40});
for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 40 + triangle(i));
}

{
std::array<size_t, 10> v;
std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 1);
std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), size_t{30});
for (size_t i = 0; i < v.size(); ++i)
std::inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), std::size_t{30});
for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 30 + triangle(i + 1));
}

{
std::array<size_t, 0> v, res;
std::inclusive_scan(v.begin(), v.end(), res.begin(), std::plus<>(), size_t{40});
std::array<std::size_t, 0> v, res;
std::inclusive_scan(v.begin(), v.end(), res.begin(), std::plus<>(), std::size_t{40});
assert(res.empty());
}

// Make sure that the calculations are done using the init typedef
{
std::array<unsigned char, 10> v;
std::iota(v.begin(), v.end(), static_cast<unsigned char>(1));
std::array<size_t, 10> res;
std::inclusive_scan(v.begin(), v.end(), res.begin(), std::multiplies<>(), size_t{1});
std::array<std::size_t, 10> res;
std::inclusive_scan(v.begin(), v.end(), res.begin(), std::multiplies<>(), std::size_t{1});

assert(res.size() == 10);
size_t j = 1;
std::size_t j = 1;
assert(res[0] == 1);
for (size_t i = 1; i < v.size(); ++i)
for (std::size_t i = 1; i < v.size(); ++i)
{
j *= i + 1;
assert(res[i] == j);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ int main(int, char**)

// int_test<char>();
signed_test<ptrdiff_t>();
unsigned_test<size_t>();
unsigned_test<std::size_t>();

return 0;
}
Original file line number Diff line number Diff line change
Expand Up @@ -88,53 +88,53 @@ test()
}
}

constexpr size_t triangle(size_t n) { return n*(n+1)/2; }
constexpr std::size_t triangle(size_t n) { return n*(n+1)/2; }

// Basic sanity
TEST_CONSTEXPR_CXX20 void
basic_tests()
{
{
std::array<size_t, 10> v;
std::array<std::size_t, 10> v;
std::fill(v.begin(), v.end(), 3);
std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), size_t{50}, std::plus<>(), add_one{});
for (size_t i = 0; i < v.size(); ++i)
std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), std::size_t{50}, std::plus<>(), add_one{});
for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 50 + i * 4);
}

{
std::array<size_t, 10> v;
std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 0);
std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), size_t{30}, std::plus<>(), add_one{});
for (size_t i = 0; i < v.size(); ++i)
std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), std::size_t{30}, std::plus<>(), add_one{});
for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 30 + triangle(i - 1) + i);
}

{
std::array<size_t, 10> v;
std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 1);
std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), size_t{40}, std::plus<>(), add_one{});
for (size_t i = 0; i < v.size(); ++i)
std::transform_exclusive_scan(v.begin(), v.end(), v.begin(), std::size_t{40}, std::plus<>(), add_one{});
for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 40 + triangle(i) + i);
}

{
std::array<size_t, 0> v, res;
std::transform_exclusive_scan(v.begin(), v.end(), res.begin(), size_t{40}, std::plus<>(), add_one{});
std::array<std::size_t, 0> v, res;
std::transform_exclusive_scan(v.begin(), v.end(), res.begin(), std::size_t{40}, std::plus<>(), add_one{});
assert(res.empty());
}

// Make sure that the calculations are done using the init typedef
{
std::array<unsigned char, 10> v;
std::iota(v.begin(), v.end(), static_cast<unsigned char>(1));
std::array<size_t, 10> res;
std::transform_exclusive_scan(v.begin(), v.end(), res.begin(), size_t{1}, std::multiplies<>(), add_one{});
std::array<std::size_t, 10> res;
std::transform_exclusive_scan(v.begin(), v.end(), res.begin(), std::size_t{1}, std::multiplies<>(), add_one{});

assert(res.size() == 10);
size_t j = 1;
std::size_t j = 1;
assert(res[0] == 1);
for (size_t i = 1; i < res.size(); ++i)
for (std::size_t i = 1; i < res.size(); ++i)
{
j *= i + 1;
assert(res[i] == j);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,38 +77,38 @@ test()
}
}

constexpr size_t triangle(size_t n) { return n*(n+1)/2; }
constexpr std::size_t triangle(size_t n) { return n*(n+1)/2; }

// Basic sanity
TEST_CONSTEXPR_CXX20 void
basic_tests()
{
{
std::array<size_t, 10> v;
std::array<std::size_t, 10> v;
std::fill(v.begin(), v.end(), 3);
std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{});
for (size_t i = 0; i < v.size(); ++i)
for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == (i+1) * 4);
}

{
std::array<size_t, 10> v;
std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 0);
std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{});
for (size_t i = 0; i < v.size(); ++i)
for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == triangle(i) + i + 1);
}

{
std::array<size_t, 10> v;
std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 1);
std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{});
for (size_t i = 0; i < v.size(); ++i)
for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == triangle(i + 1) + i + 1);
}

{
std::array<size_t, 0> v, res;
std::array<std::size_t, 0> v, res;
std::transform_inclusive_scan(v.begin(), v.end(), res.begin(), std::plus<>(), add_one{});
assert(res.empty());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,53 +90,53 @@ test()
}
}

constexpr size_t triangle(size_t n) { return n*(n+1)/2; }
constexpr std::size_t triangle(size_t n) { return n*(n+1)/2; }

// Basic sanity
TEST_CONSTEXPR_CXX20 void
basic_tests()
{
{
std::array<size_t, 10> v;
std::array<std::size_t, 10> v;
std::fill(v.begin(), v.end(), 3);
std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, size_t{50});
for (size_t i = 0; i < v.size(); ++i)
std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, std::size_t{50});
for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 50 + (i + 1) * 4);
}

{
std::array<size_t, 10> v;
std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 0);
std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, size_t{30});
for (size_t i = 0; i < v.size(); ++i)
std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, std::size_t{30});
for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 30 + triangle(i) + i + 1);
}

{
std::array<size_t, 10> v;
std::array<std::size_t, 10> v;
std::iota(v.begin(), v.end(), 1);
std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, size_t{40});
for (size_t i = 0; i < v.size(); ++i)
std::transform_inclusive_scan(v.begin(), v.end(), v.begin(), std::plus<>(), add_one{}, std::size_t{40});
for (std::size_t i = 0; i < v.size(); ++i)
assert(v[i] == 40 + triangle(i + 1) + i + 1);
}

{
std::array<size_t, 0> v, res;
std::transform_inclusive_scan(v.begin(), v.end(), res.begin(), std::plus<>(), add_one{}, size_t{1});
std::array<std::size_t, 0> v, res;
std::transform_inclusive_scan(v.begin(), v.end(), res.begin(), std::plus<>(), add_one{}, std::size_t{1});
assert(res.empty());
}

// Make sure that the calculations are done using the init typedef
{
std::array<unsigned char, 10> v;
std::iota(v.begin(), v.end(), static_cast<unsigned char>(1));
std::array<size_t, 10> res;
std::transform_inclusive_scan(v.begin(), v.end(), res.begin(), std::multiplies<>(), add_one{}, size_t{1});
std::array<std::size_t, 10> res;
std::transform_inclusive_scan(v.begin(), v.end(), res.begin(), std::multiplies<>(), add_one{}, std::size_t{1});

assert(res.size() == 10);
size_t j = 2;
std::size_t j = 2;
assert(res[0] == 2);
for (size_t i = 1; i < res.size(); ++i)
for (std::size_t i = 1; i < res.size(); ++i)
{
j *= i + 2;
assert(res[i] == j);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ test1()
G g;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5};
const size_t Np = sizeof(p) / sizeof(p[0]);
const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
const int N = 1000000;
std::vector<D::result_type> u;
Expand All @@ -60,7 +60,7 @@ test1()
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
const size_t Ni = ub - lb;
const std::size_t Ni = ub - lb;
if (prob[i] == 0)
assert(Ni == 0);
else
Expand Down Expand Up @@ -103,7 +103,7 @@ test2()
G g;
double b[] = {10, 14, 16, 17};
double p[] = {0, 62.5, 12.5};
const size_t Np = sizeof(p) / sizeof(p[0]);
const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
const int N = 1000000;
std::vector<D::result_type> u;
Expand All @@ -123,7 +123,7 @@ test2()
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
const size_t Ni = ub - lb;
const std::size_t Ni = ub - lb;
if (prob[i] == 0)
assert(Ni == 0);
else
Expand Down Expand Up @@ -166,7 +166,7 @@ test3()
G g;
double b[] = {10, 14, 16, 17};
double p[] = {25, 0, 12.5};
const size_t Np = sizeof(p) / sizeof(p[0]);
const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
const int N = 1000000;
std::vector<D::result_type> u;
Expand All @@ -186,7 +186,7 @@ test3()
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
const size_t Ni = ub - lb;
const std::size_t Ni = ub - lb;
if (prob[i] == 0)
assert(Ni == 0);
else
Expand Down Expand Up @@ -229,7 +229,7 @@ test4()
G g;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 0};
const size_t Np = sizeof(p) / sizeof(p[0]);
const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
const int N = 1000000;
std::vector<D::result_type> u;
Expand All @@ -249,7 +249,7 @@ test4()
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
const size_t Ni = ub - lb;
const std::size_t Ni = ub - lb;
if (prob[i] == 0)
assert(Ni == 0);
else
Expand Down Expand Up @@ -292,7 +292,7 @@ test5()
G g;
double b[] = {10, 14, 16, 17};
double p[] = {25, 0, 0};
const size_t Np = sizeof(p) / sizeof(p[0]);
const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
const int N = 100000;
std::vector<D::result_type> u;
Expand All @@ -312,7 +312,7 @@ test5()
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
const size_t Ni = ub - lb;
const std::size_t Ni = ub - lb;
if (prob[i] == 0)
assert(Ni == 0);
else
Expand Down Expand Up @@ -355,7 +355,7 @@ test6()
G g;
double b[] = {10, 14, 16, 17};
double p[] = {0, 25, 0};
const size_t Np = sizeof(p) / sizeof(p[0]);
const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
const int N = 100000;
std::vector<D::result_type> u;
Expand All @@ -375,7 +375,7 @@ test6()
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
const size_t Ni = ub - lb;
const std::size_t Ni = ub - lb;
if (prob[i] == 0)
assert(Ni == 0);
else
Expand Down Expand Up @@ -418,7 +418,7 @@ test7()
G g;
double b[] = {10, 14, 16, 17};
double p[] = {0, 0, 1};
const size_t Np = sizeof(p) / sizeof(p[0]);
const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
const int N = 100000;
std::vector<D::result_type> u;
Expand All @@ -438,7 +438,7 @@ test7()
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
const size_t Ni = ub - lb;
const std::size_t Ni = ub - lb;
if (prob[i] == 0)
assert(Ni == 0);
else
Expand Down Expand Up @@ -481,7 +481,7 @@ test8()
G g;
double b[] = {10, 14, 16};
double p[] = {75, 25};
const size_t Np = sizeof(p) / sizeof(p[0]);
const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
const int N = 100000;
std::vector<D::result_type> u;
Expand All @@ -501,7 +501,7 @@ test8()
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
const size_t Ni = ub - lb;
const std::size_t Ni = ub - lb;
if (prob[i] == 0)
assert(Ni == 0);
else
Expand Down Expand Up @@ -544,7 +544,7 @@ test9()
G g;
double b[] = {10, 14, 16};
double p[] = {0, 25};
const size_t Np = sizeof(p) / sizeof(p[0]);
const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
const int N = 100000;
std::vector<D::result_type> u;
Expand All @@ -564,7 +564,7 @@ test9()
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
const size_t Ni = ub - lb;
const std::size_t Ni = ub - lb;
if (prob[i] == 0)
assert(Ni == 0);
else
Expand Down Expand Up @@ -607,7 +607,7 @@ test10()
G g;
double b[] = {10, 14, 16};
double p[] = {1, 0};
const size_t Np = sizeof(p) / sizeof(p[0]);
const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
const int N = 100000;
std::vector<D::result_type> u;
Expand All @@ -627,7 +627,7 @@ test10()
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
const size_t Ni = ub - lb;
const std::size_t Ni = ub - lb;
if (prob[i] == 0)
assert(Ni == 0);
else
Expand Down Expand Up @@ -670,7 +670,7 @@ test11()
G g;
double b[] = {10, 14};
double p[] = {1};
const size_t Np = sizeof(p) / sizeof(p[0]);
const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
const int N = 100000;
std::vector<D::result_type> u;
Expand All @@ -690,7 +690,7 @@ test11()
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
const size_t Ni = ub - lb;
const std::size_t Ni = ub - lb;
if (prob[i] == 0)
assert(Ni == 0);
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ int main(int, char**)
G g;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5};
const size_t Np = sizeof(p) / sizeof(p[0]);
const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d;
P pa(b, b+Np+1, p);
const int N = 1000000;
Expand All @@ -63,7 +63,7 @@ int main(int, char**)
typedef std::vector<D::result_type>::iterator I;
I lb = std::lower_bound(u.begin(), u.end(), b[i]);
I ub = std::lower_bound(u.begin(), u.end(), b[i+1]);
const size_t Ni = ub - lb;
const std::size_t Ni = ub - lb;
if (prob[i] == 0)
assert(Ni == 0);
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ int main(int, char**)
typedef D::param_type P;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5};
const size_t Np = sizeof(p) / sizeof(p[0]);
const std::size_t Np = sizeof(p) / sizeof(p[0]);
P pa(b, b+Np+1, p);
D d(pa);
assert(d.param() == pa);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int main(int, char**)
typedef std::piecewise_constant_distribution<> D;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5};
const size_t Np = sizeof(p) / sizeof(p[0]);
const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d1(b, b+Np+1, p);
std::ostringstream os;
os << d1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ int main(int, char**)
typedef std::piecewise_constant_distribution<> D;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5};
const size_t Np = sizeof(p) / sizeof(p[0]);
const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
assert(d.max() == 17);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ int main(int, char**)
typedef std::piecewise_constant_distribution<> D;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5};
const size_t Np = sizeof(p) / sizeof(p[0]);
const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np+1, p);
assert(d.min() == 10);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ int main(int, char**)
typedef D::param_type P;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5};
const size_t Np = sizeof(p) / sizeof(p[0]);
const std::size_t Np = sizeof(p) / sizeof(p[0]);
P p0(b, b+Np+1, p);
P p1;
p1 = p0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ int main(int, char**)
typedef D::param_type P;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5};
const size_t Np = sizeof(p) / sizeof(p[0]);
const std::size_t Np = sizeof(p) / sizeof(p[0]);
P p0(b, b+Np+1, p);
P p1 = p0;
assert(p1 == p0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ test1()
G g;
double b[] = {10, 14, 16, 17};
double p[] = {0, 1, 1, 0};
const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
const std::size_t Np = sizeof(p) / sizeof(p[0]) - 1;
D d(b, b+Np+1, p);
const int N = 1000000;
std::vector<D::result_type> u;
for (size_t i = 0; i < N; ++i)
for (std::size_t i = 0; i < N; ++i)
{
D::result_type v = d(g);
assert(d.min() <= v && v < d.max());
Expand All @@ -65,16 +65,16 @@ test1()
double c = std::numeric_limits<double>::quiet_NaN();
std::vector<double> areas(Np);
double S = 0;
for (size_t i = 0; i < areas.size(); ++i)
for (std::size_t i = 0; i < areas.size(); ++i)
{
areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
S += areas[i];
}
for (size_t i = 0; i < areas.size(); ++i)
for (std::size_t i = 0; i < areas.size(); ++i)
areas[i] /= S;
for (size_t i = 0; i < Np+1; ++i)
for (std::size_t i = 0; i < Np+1; ++i)
p[i] /= S;
for (size_t i = 0; i < N; ++i)
for (std::size_t i = 0; i < N; ++i)
{
int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
if (k != kp)
Expand All @@ -99,11 +99,11 @@ test2()
G g;
double b[] = {10, 14, 16, 17};
double p[] = {0, 0, 1, 0};
const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
const std::size_t Np = sizeof(p) / sizeof(p[0]) - 1;
D d(b, b+Np+1, p);
const int N = 1000000;
std::vector<D::result_type> u;
for (size_t i = 0; i < N; ++i)
for (std::size_t i = 0; i < N; ++i)
{
D::result_type v = d(g);
assert(d.min() <= v && v < d.max());
Expand All @@ -117,16 +117,16 @@ test2()
double c = std::numeric_limits<double>::quiet_NaN();
std::vector<double> areas(Np);
double S = 0;
for (size_t i = 0; i < areas.size(); ++i)
for (std::size_t i = 0; i < areas.size(); ++i)
{
areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
S += areas[i];
}
for (size_t i = 0; i < areas.size(); ++i)
for (std::size_t i = 0; i < areas.size(); ++i)
areas[i] /= S;
for (size_t i = 0; i < Np+1; ++i)
for (std::size_t i = 0; i < Np+1; ++i)
p[i] /= S;
for (size_t i = 0; i < N; ++i)
for (std::size_t i = 0; i < N; ++i)
{
int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
if (k != kp)
Expand All @@ -151,11 +151,11 @@ test3()
G g;
double b[] = {10, 14, 16, 17};
double p[] = {1, 0, 0, 0};
const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
const std::size_t Np = sizeof(p) / sizeof(p[0]) - 1;
D d(b, b+Np+1, p);
const size_t N = 1000000;
const std::size_t N = 1000000;
std::vector<D::result_type> u;
for (size_t i = 0; i < N; ++i)
for (std::size_t i = 0; i < N; ++i)
{
D::result_type v = d(g);
assert(d.min() <= v && v < d.max());
Expand All @@ -169,16 +169,16 @@ test3()
double c = std::numeric_limits<double>::quiet_NaN();
std::vector<double> areas(Np);
double S = 0;
for (size_t i = 0; i < areas.size(); ++i)
for (std::size_t i = 0; i < areas.size(); ++i)
{
areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
S += areas[i];
}
for (size_t i = 0; i < areas.size(); ++i)
for (std::size_t i = 0; i < areas.size(); ++i)
areas[i] /= S;
for (size_t i = 0; i < Np+1; ++i)
for (std::size_t i = 0; i < Np+1; ++i)
p[i] /= S;
for (size_t i = 0; i < N; ++i)
for (std::size_t i = 0; i < N; ++i)
{
int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
if (k != kp)
Expand All @@ -203,11 +203,11 @@ test4()
G g;
double b[] = {10, 14, 16};
double p[] = {0, 1, 0};
const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
const std::size_t Np = sizeof(p) / sizeof(p[0]) - 1;
D d(b, b+Np+1, p);
const int N = 1000000;
std::vector<D::result_type> u;
for (size_t i = 0; i < N; ++i)
for (std::size_t i = 0; i < N; ++i)
{
D::result_type v = d(g);
assert(d.min() <= v && v < d.max());
Expand All @@ -221,16 +221,16 @@ test4()
double c = std::numeric_limits<double>::quiet_NaN();
std::vector<double> areas(Np);
double S = 0;
for (size_t i = 0; i < areas.size(); ++i)
for (std::size_t i = 0; i < areas.size(); ++i)
{
areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
S += areas[i];
}
for (size_t i = 0; i < areas.size(); ++i)
for (std::size_t i = 0; i < areas.size(); ++i)
areas[i] /= S;
for (size_t i = 0; i < Np+1; ++i)
for (std::size_t i = 0; i < Np+1; ++i)
p[i] /= S;
for (size_t i = 0; i < N; ++i)
for (std::size_t i = 0; i < N; ++i)
{
int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
if (k != kp)
Expand All @@ -256,11 +256,11 @@ test5()
G g;
double b[] = {10, 14};
double p[] = {1, 1};
const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
const std::size_t Np = sizeof(p) / sizeof(p[0]) - 1;
D d(b, b+Np+1, p);
const int N = 1000000;
std::vector<D::result_type> u;
for (size_t i = 0; i < N; ++i)
for (std::size_t i = 0; i < N; ++i)
{
D::result_type v = d(g);
assert(d.min() <= v && v < d.max());
Expand All @@ -274,17 +274,17 @@ test5()
double c = std::numeric_limits<double>::quiet_NaN();
std::vector<double> areas(Np);
double S = 0;
for (size_t i = 0; i < areas.size(); ++i)
for (std::size_t i = 0; i < areas.size(); ++i)
{
assert(i < Np);
areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
S += areas[i];
}
for (size_t i = 0; i < areas.size(); ++i)
for (std::size_t i = 0; i < areas.size(); ++i)
areas[i] /= S;
for (size_t i = 0; i < Np+1; ++i)
for (std::size_t i = 0; i < Np+1; ++i)
p[i] /= S;
for (size_t i = 0; i < N; ++i)
for (std::size_t i = 0; i < N; ++i)
{
int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
if (k != kp)
Expand All @@ -310,11 +310,11 @@ test6()
G g;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5, 0};
const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
const std::size_t Np = sizeof(p) / sizeof(p[0]) - 1;
D d(b, b+Np+1, p);
const int N = 1000000;
std::vector<D::result_type> u;
for (size_t i = 0; i < N; ++i)
for (std::size_t i = 0; i < N; ++i)
{
D::result_type v = d(g);
assert(d.min() <= v && v < d.max());
Expand All @@ -328,16 +328,16 @@ test6()
double c = std::numeric_limits<double>::quiet_NaN();
std::vector<double> areas(Np);
double S = 0;
for (size_t i = 0; i < areas.size(); ++i)
for (std::size_t i = 0; i < areas.size(); ++i)
{
areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
S += areas[i];
}
for (size_t i = 0; i < areas.size(); ++i)
for (std::size_t i = 0; i < areas.size(); ++i)
areas[i] /= S;
for (size_t i = 0; i < Np+1; ++i)
for (std::size_t i = 0; i < Np+1; ++i)
p[i] /= S;
for (size_t i = 0; i < N; ++i)
for (std::size_t i = 0; i < N; ++i)
{
int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
if (k != kp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ int main(int, char**)
G g;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5, 0};
const size_t Np = sizeof(p) / sizeof(p[0]) - 1;
const std::size_t Np = sizeof(p) / sizeof(p[0]) - 1;
D d;
P pa(b, b+Np+1, p);
const size_t N = 1000000;
const std::size_t N = 1000000;
std::vector<D::result_type> u;
for (size_t i = 0; i < N; ++i)
for (std::size_t i = 0; i < N; ++i)
{
D::result_type v = d(g, pa);
assert(10 <= v && v < 17);
Expand All @@ -67,16 +67,16 @@ int main(int, char**)
double c = std::numeric_limits<double>::quiet_NaN();
std::vector<double> areas(Np);
double S = 0;
for (size_t i = 0; i < areas.size(); ++i)
for (std::size_t i = 0; i < areas.size(); ++i)
{
areas[i] = (p[i]+p[i+1])*(b[i+1]-b[i])/2;
S += areas[i];
}
for (size_t i = 0; i < areas.size(); ++i)
for (std::size_t i = 0; i < areas.size(); ++i)
areas[i] /= S;
for (size_t i = 0; i < Np+1; ++i)
for (std::size_t i = 0; i < Np+1; ++i)
p[i] /= S;
for (size_t i = 0; i < N; ++i)
for (std::size_t i = 0; i < N; ++i)
{
int k = std::lower_bound(b, b+Np+1, u[i]) - b - 1;
if (k != kp)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ int main(int, char**)
typedef D::param_type P;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5, 10};
const size_t Np = sizeof(p) / sizeof(p[0]);
const std::size_t Np = sizeof(p) / sizeof(p[0]);
P pa(b, b+Np, p);
D d(pa);
assert(d.param() == pa);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ int main(int, char**)
typedef std::piecewise_linear_distribution<> D;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5, 25};
const size_t Np = sizeof(p) / sizeof(p[0]);
const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d1(b, b+Np, p);
std::ostringstream os;
os << d1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ int main(int, char**)
typedef std::piecewise_linear_distribution<> D;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5, 5};
const size_t Np = sizeof(p) / sizeof(p[0]);
const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np, p);
assert(d.max() == 17);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ int main(int, char**)
typedef std::piecewise_linear_distribution<> D;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5, 0};
const size_t Np = sizeof(p) / sizeof(p[0]);
const std::size_t Np = sizeof(p) / sizeof(p[0]);
D d(b, b+Np, p);
assert(d.min() == 10);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ int main(int, char**)
typedef D::param_type P;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5, 2};
const size_t Np = sizeof(p) / sizeof(p[0]);
const std::size_t Np = sizeof(p) / sizeof(p[0]);
P p0(b, b+Np, p);
P p1;
p1 = p0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ int main(int, char**)
typedef D::param_type P;
double b[] = {10, 14, 16, 17};
double p[] = {25, 62.5, 12.5, 5};
const size_t Np = sizeof(p) / sizeof(p[0]);
const std::size_t Np = sizeof(p) / sizeof(p[0]);
P p0(b, b+Np, p);
P p1 = p0;
assert(p1 == p0);
Expand Down
10 changes: 5 additions & 5 deletions libcxx/test/std/ranges/range.access/empty.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ constexpr bool testEmptyMember() {
}

struct SizeMember {
size_t size_;
constexpr size_t size() const { return size_; }
std::size_t size_;
constexpr std::size_t size() const { return size_; }
};

struct SizeFunction {
size_t size_;
friend constexpr size_t size(SizeFunction sf) { return sf.size_; }
std::size_t size_;
friend constexpr std::size_t size(SizeFunction sf) { return sf.size_; }
};

struct BeginEndSizedSentinel {
Expand Down Expand Up @@ -131,7 +131,7 @@ static_assert(!std::ranges::sized_range<BeginEndNotSizedSentinel>);
struct DisabledSizeRangeWithBeginEnd {
constexpr int *begin() const { return nullptr; }
constexpr auto end() const { return sentinel_wrapper<int*>(nullptr); }
size_t size() const;
std::size_t size() const;
};
template<>
inline constexpr bool std::ranges::disable_sized_range<DisabledSizeRangeWithBeginEnd> = true;
Expand Down
56 changes: 28 additions & 28 deletions libcxx/test/std/ranges/range.access/size.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,23 +35,23 @@ static_assert(std::ranges::size(std::as_const(array_of_incomplete)) == 42);
static_assert(std::ranges::size(static_cast<const Incomplete(&&)[42]>(array_of_incomplete)) == 42);

struct SizeMember {
constexpr size_t size() { return 42; }
constexpr std::size_t size() { return 42; }
};

struct StaticSizeMember {
constexpr static size_t size() { return 42; }
constexpr static std::size_t size() { return 42; }
};

static_assert(!std::is_invocable_v<RangeSizeT, const SizeMember>);

struct SizeFunction {
friend constexpr size_t size(SizeFunction) { return 42; }
friend constexpr std::size_t size(SizeFunction) { return 42; }
};

// Make sure the size member is preferred.
struct SizeMemberAndFunction {
constexpr size_t size() { return 42; }
friend constexpr size_t size(SizeMemberAndFunction) { return 0; }
constexpr std::size_t size() { return 42; }
friend constexpr std::size_t size(SizeMemberAndFunction) { return 0; }
};

bool constexpr testArrayType() {
Expand All @@ -61,19 +61,19 @@ bool constexpr testArrayType() {
SizeFunction d[4];

assert(std::ranges::size(a) == 4);
ASSERT_SAME_TYPE(decltype(std::ranges::size(a)), size_t);
ASSERT_SAME_TYPE(decltype(std::ranges::size(a)), std::size_t);
assert(std::ranges::size(b) == 1);
ASSERT_SAME_TYPE(decltype(std::ranges::size(b)), size_t);
ASSERT_SAME_TYPE(decltype(std::ranges::size(b)), std::size_t);
assert(std::ranges::size(c) == 4);
ASSERT_SAME_TYPE(decltype(std::ranges::size(c)), size_t);
ASSERT_SAME_TYPE(decltype(std::ranges::size(c)), std::size_t);
assert(std::ranges::size(d) == 4);
ASSERT_SAME_TYPE(decltype(std::ranges::size(d)), size_t);
ASSERT_SAME_TYPE(decltype(std::ranges::size(d)), std::size_t);

return true;
}

struct SizeMemberConst {
constexpr size_t size() const { return 42; }
constexpr std::size_t size() const { return 42; }
};

struct SizeMemberSigned {
Expand All @@ -82,7 +82,7 @@ struct SizeMemberSigned {

bool constexpr testHasSizeMember() {
assert(std::ranges::size(SizeMember()) == 42);
ASSERT_SAME_TYPE(decltype(std::ranges::size(SizeMember())), size_t);
ASSERT_SAME_TYPE(decltype(std::ranges::size(SizeMember())), std::size_t);

const SizeMemberConst sizeMemberConst;
assert(std::ranges::size(sizeMemberConst) == 42);
Expand All @@ -93,7 +93,7 @@ bool constexpr testHasSizeMember() {
ASSERT_SAME_TYPE(decltype(std::ranges::size(SizeMemberSigned())), long);

assert(std::ranges::size(StaticSizeMember()) == 42);
ASSERT_SAME_TYPE(decltype(std::ranges::size(StaticSizeMember())), size_t);
ASSERT_SAME_TYPE(decltype(std::ranges::size(StaticSizeMember())), std::size_t);

return true;
}
Expand All @@ -103,25 +103,25 @@ struct MoveOnlySizeFunction {
MoveOnlySizeFunction(MoveOnlySizeFunction &&) = default;
MoveOnlySizeFunction(MoveOnlySizeFunction const&) = delete;

friend constexpr size_t size(MoveOnlySizeFunction) { return 42; }
friend constexpr std::size_t size(MoveOnlySizeFunction) { return 42; }
};

enum EnumSizeFunction {
a, b
};

constexpr size_t size(EnumSizeFunction) { return 42; }
constexpr std::size_t size(EnumSizeFunction) { return 42; }

struct SizeFunctionConst {
friend constexpr size_t size(const SizeFunctionConst) { return 42; }
friend constexpr std::size_t size(const SizeFunctionConst) { return 42; }
};

struct SizeFunctionRef {
friend constexpr size_t size(SizeFunctionRef&) { return 42; }
friend constexpr std::size_t size(SizeFunctionRef&) { return 42; }
};

struct SizeFunctionConstRef {
friend constexpr size_t size(SizeFunctionConstRef const&) { return 42; }
friend constexpr std::size_t size(SizeFunctionConstRef const&) { return 42; }
};

struct SizeFunctionSigned {
Expand All @@ -130,7 +130,7 @@ struct SizeFunctionSigned {

bool constexpr testHasSizeFunction() {
assert(std::ranges::size(SizeFunction()) == 42);
ASSERT_SAME_TYPE(decltype(std::ranges::size(SizeFunction())), size_t);
ASSERT_SAME_TYPE(decltype(std::ranges::size(SizeFunction())), std::size_t);
static_assert(!std::is_invocable_v<RangeSizeT, MoveOnlySizeFunction>);
assert(std::ranges::size(EnumSizeFunction()) == 42);
assert(std::ranges::size(SizeFunctionConst()) == 42);
Expand Down Expand Up @@ -159,7 +159,7 @@ struct InvalidReturnTypeFunction {
};

struct Convertible {
operator size_t();
operator std::size_t();
};

struct ConvertibleReturnTypeMember {
Expand Down Expand Up @@ -188,14 +188,14 @@ static_assert(!std::is_invocable_v<RangeSizeT, BoolReturnTypeMember const&>);
static_assert(!std::is_invocable_v<RangeSizeT, BoolReturnTypeFunction const&>);

struct SizeMemberDisabled {
size_t size() { return 42; }
std::size_t size() { return 42; }
};

template <>
inline constexpr bool std::ranges::disable_sized_range<SizeMemberDisabled> = true;

struct ImproperlyDisabledMember {
size_t size() const { return 42; }
std::size_t size() const { return 42; }
};

// Intentionally disabling "const ConstSizeMemberDisabled". This doesn't disable anything
Expand All @@ -204,14 +204,14 @@ template <>
inline constexpr bool std::ranges::disable_sized_range<const ImproperlyDisabledMember> = true;

struct SizeFunctionDisabled {
friend size_t size(SizeFunctionDisabled) { return 42; }
friend std::size_t size(SizeFunctionDisabled) { return 42; }
};

template <>
inline constexpr bool std::ranges::disable_sized_range<SizeFunctionDisabled> = true;

struct ImproperlyDisabledFunction {
friend size_t size(ImproperlyDisabledFunction const&) { return 42; }
friend std::size_t size(ImproperlyDisabledFunction const&) { return 42; }
};

template <>
Expand All @@ -224,7 +224,7 @@ static_assert( std::is_invocable_v<RangeSizeT, const ImproperlyDisabledFunction&

// No begin end.
struct HasMinusOperator {
friend constexpr size_t operator-(HasMinusOperator, HasMinusOperator) { return 2; }
friend constexpr std::size_t operator-(HasMinusOperator, HasMinusOperator) { return 2; }
};
static_assert(!std::is_invocable_v<RangeSizeT, HasMinusOperator>);

Expand Down Expand Up @@ -277,7 +277,7 @@ struct DisabledSizeRangeWithBeginEnd {
int buff[8];
constexpr int* begin() { return buff; }
constexpr int* end() { return buff + 8; }
constexpr size_t size() { return 1; }
constexpr std::size_t size() { return 1; }
};

template <>
Expand All @@ -287,14 +287,14 @@ struct SizeBeginAndEndMembers {
int buff[8];
constexpr int* begin() { return buff; }
constexpr int* end() { return buff + 8; }
constexpr size_t size() { return 1; }
constexpr std::size_t size() { return 1; }
};

constexpr bool testRanges() {
HasMinusBeginEnd a;
assert(std::ranges::size(a) == 2);
// Ensure that this is converted to an *unsigned* type.
ASSERT_SAME_TYPE(decltype(std::ranges::size(a)), size_t);
ASSERT_SAME_TYPE(decltype(std::ranges::size(a)), std::size_t);

IntPtrBeginAndEnd b;
assert(std::ranges::size(b) == 8);
Expand All @@ -304,7 +304,7 @@ constexpr bool testRanges() {

RandomAccessRange d;
assert(std::ranges::size(d) == 2);
ASSERT_SAME_TYPE(decltype(std::ranges::size(d)), size_t);
ASSERT_SAME_TYPE(decltype(std::ranges::size(d)), std::size_t);

SizeBeginAndEndMembers e;
assert(std::ranges::size(e) == 1);
Expand Down
6 changes: 3 additions & 3 deletions libcxx/test/std/ranges/range.access/ssize.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ static_assert( std::is_invocable_v<RangeSSizeT, int (&&)[1]>);
static_assert( std::is_invocable_v<RangeSSizeT, int (&)[1]>);

struct SizeMember {
constexpr size_t size() { return 42; }
constexpr std::size_t size() { return 42; }
};
static_assert(!std::is_invocable_v<decltype(std::ranges::ssize), const SizeMember&>);

struct SizeFunction {
friend constexpr size_t size(SizeFunction) { return 42; }
friend constexpr std::size_t size(SizeFunction) { return 42; }
};

struct SizeFunctionSigned {
Expand All @@ -47,7 +47,7 @@ struct ShortUnsignedReturnType {
};

// size_t changes depending on the platform.
using SignedSizeT = std::make_signed_t<size_t>;
using SignedSizeT = std::make_signed_t<std::size_t>;

constexpr bool test() {
int a[4];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct ConstSizedView : std::ranges::view_base {
int* begin() const;
int* end() const;

constexpr size_t size() const {
constexpr std::size_t size() const {
*size_called = true;
return 3;
}
Expand Down Expand Up @@ -56,7 +56,7 @@ constexpr bool test() {
{
bool size_called = false;
std::ranges::as_rvalue_view view(ConstSizedView{{}, &size_called});
std::same_as<size_t> auto size = view.size();
std::same_as<std::size_t> auto size = view.size();
assert(size == 3);
assert(size_called);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ constexpr bool test() {
{
static_assert(std::addressof(std::views::counted) == std::addressof(std::ranges::views::counted));

static_assert( CountedInvocable<int*, size_t>);
static_assert( CountedInvocable<int*, std::size_t>);
static_assert(!CountedInvocable<int*, LvalueConvertible>);
static_assert( CountedInvocable<int*, LvalueConvertible&>);
static_assert( CountedInvocable<int*, RvalueConvertible>);
static_assert(!CountedInvocable<int*, RvalueConvertible&>);
static_assert(!CountedInvocable<int*, OnlyExplicitlyConvertible>);
static_assert(!CountedInvocable<int*, int*>);
static_assert(!CountedInvocable<int*>);
static_assert(!CountedInvocable<size_t>);
static_assert(!CountedInvocable<std::size_t>);
static_assert(!CountedInvocable<>);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ struct SizedViewWithUnsizedSentinel : std::ranges::view_base {

constexpr auto begin() const { return iterator(begin_); }
constexpr auto end() const { return sentinel(iterator(end_)); }
constexpr size_t size() const { return end_ - begin_; }
constexpr std::size_t size() const { return end_ - begin_; }
};
static_assert(std::ranges::random_access_range<SizedViewWithUnsizedSentinel>);
static_assert(std::ranges::sized_range<SizedViewWithUnsizedSentinel>);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ struct MaybeSimpleView : std::ranges::view_base {
return nullptr;
}
constexpr int* end() const { return nullptr; }
constexpr size_t size() const { return 0; }
constexpr std::size_t size() const { return 0; }
};

using SimpleView = MaybeSimpleView<true>;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct IterNoDefaultCtrView : std::ranges::view_base {
sentinel_wrapper<cpp20_input_iterator<std::tuple<int>*>> end() const;
};

template <class View, size_t N>
template <class View, std::size_t N>
using ElementsIter = std::ranges::iterator_t<std::ranges::elements_view<View, N>>;

static_assert(!std::default_initializable<ElementsIter<IterNoDefaultCtrView, 0>>);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
template <class Iter>
using Range = std::ranges::subrange<Iter, sentinel_wrapper<Iter>>;

template <class Range, size_t N = 0>
template <class Range, std::size_t N = 0>
using ElementsIter = std::ranges::iterator_t<std::ranges::elements_view<Range, N>>;

// using iterator_concept = see below;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
template <class It>
using Range = std::ranges::subrange<It, sentinel_wrapper<It>>;

template <class V, size_t N>
template <class V, std::size_t N>
concept HasElementsView = requires { typename std::ranges::elements_view<V, N>; };

static_assert(HasElementsView<Range<std::ranges::subrange<int*>*>, 0>);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ namespace test8 {
struct AlmostTinyRange : std::ranges::view_base {
int* begin() const;
int* end() const;
static size_t size() { return 1; }
static std::size_t size() { return 1; }
};

using View = InputView;
Expand All @@ -192,7 +192,7 @@ namespace test9 {
struct AlmostTinyRange : std::ranges::view_base {
int* begin() const;
int* end() const;
constexpr static size_t size() { return 2; }
constexpr static std::size_t size() { return 2; }
};

using View = InputView;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,13 +75,13 @@ constexpr bool is_equal(View& view, const Expected& expected) {
return actual_it == view.end() && expected_it == expected.end();
}

template <class T, class Separator, class U, size_t M>
template <class T, class Separator, class U, std::size_t M>
constexpr bool test_function_call(T&& input, Separator&& separator, std::array<U, M> expected) {
std::ranges::lazy_split_view v(input, separator);
return is_equal(v, expected);
}

template <class T, class Separator, class U, size_t M>
template <class T, class Separator, class U, std::size_t M>
constexpr bool test_with_piping(T&& input, Separator&& separator, std::array<U, M> expected) {
auto expected_it = expected.begin();
for (auto e : input | std::ranges::views::lazy_split(separator)) {
Expand Down Expand Up @@ -166,7 +166,7 @@ constexpr std::string_view sv(T&& str) {
return std::string_view(str);
};

template <class T, class Separator, class U, size_t M>
template <class T, class Separator, class U, std::size_t M>
constexpr void test_one(T&& input, Separator&& separator, std::array<U, M> expected) {
assert(test_function_call(input, separator, expected));
assert(test_with_piping(input, separator, expected));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
struct EmptyView : std::ranges::view_base {
constexpr int* begin() const { return nullptr; }
constexpr int* end() const { return nullptr; }
constexpr static size_t size() { return 0; }
constexpr static std::size_t size() { return 0; }
};
static_assert(std::ranges::forward_range<EmptyView>);
static_assert(std::ranges::view<EmptyView>);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
#define TEST_STD_RANGES_RANGE_ADAPTORS_RANGE_LAZY_SPLIT_TYPES_H

#include <concepts>
#include <cstddef>
#include <ranges>
#include <string>
#include <string_view>
Expand Down Expand Up @@ -174,7 +175,7 @@ struct ForwardTinyView : std::ranges::view_base {
constexpr ForwardTinyView(char c) { *c_ = c; }
constexpr forward_iterator<const char*> begin() const { return forward_iterator<const char*>(c_); }
constexpr forward_iterator<const char*> end() const { return forward_iterator<const char*>(c_ + 1); }
constexpr static size_t size() { return 1; }
constexpr static std::size_t size() { return 1; }
};
static_assert(std::ranges::forward_range<ForwardTinyView>);
static_assert(std::ranges::view<ForwardTinyView>);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
template<CopyCategory CC>
struct BidirSizedRange : std::ranges::view_base {
int *ptr_;
size_t size_;
std::size_t size_;

constexpr BidirSizedRange(int *ptr, size_t size) : ptr_(ptr), size_(size) {}
constexpr BidirSizedRange(int *ptr, std::size_t size) : ptr_(ptr), size_(size) {}
constexpr BidirSizedRange(const BidirSizedRange &) requires (CC == Copyable) = default;
constexpr BidirSizedRange(BidirSizedRange &&) requires (CC == MoveOnly) = default;
constexpr BidirSizedRange& operator=(const BidirSizedRange &) requires (CC == Copyable) = default;
Expand All @@ -36,7 +36,7 @@ struct BidirSizedRange : std::ranges::view_base {
constexpr bidirectional_iterator<int*> end() { return bidirectional_iterator<int*>{ptr_ + 8}; }
constexpr bidirectional_iterator<const int*> end() const { return bidirectional_iterator<const int*>{ptr_ + 8}; }

constexpr size_t size() const { return size_; }
constexpr std::size_t size() const { return size_; }
};

constexpr bool test() {
Expand All @@ -49,8 +49,8 @@ constexpr bool test() {
assert(rev.size() == 4);
assert(std::move(rev).size() == 4);

ASSERT_SAME_TYPE(decltype(rev.size()), size_t);
ASSERT_SAME_TYPE(decltype(std::move(rev).size()), size_t);
ASSERT_SAME_TYPE(decltype(rev.size()), std::size_t);
ASSERT_SAME_TYPE(decltype(std::move(rev).size()), std::size_t);
}
// Non-common, const bidirectional range.
{
Expand All @@ -59,15 +59,15 @@ constexpr bool test() {
assert(rev.size() == 4);
assert(std::move(rev).size() == 4);

ASSERT_SAME_TYPE(decltype(rev.size()), size_t);
ASSERT_SAME_TYPE(decltype(std::move(rev).size()), size_t);
ASSERT_SAME_TYPE(decltype(rev.size()), std::size_t);
ASSERT_SAME_TYPE(decltype(std::move(rev).size()), std::size_t);
}
// Non-common, non-const (move only) bidirectional range.
{
auto rev = std::ranges::reverse_view(BidirSizedRange<MoveOnly>{buffer, 4});
assert(std::move(rev).size() == 4);

ASSERT_SAME_TYPE(decltype(std::move(rev).size()), size_t);
ASSERT_SAME_TYPE(decltype(std::move(rev).size()), std::size_t);
}

return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,13 +33,13 @@ constexpr bool is_equal(View& view, const Expected& expected) {
return std::ranges::equal(view, expected, std::ranges::equal);
}

template <class T, class Separator, class U, size_t M>
template <class T, class Separator, class U, std::size_t M>
constexpr bool test_function_call(T&& input, Separator&& separator, std::array<U, M> expected) {
std::ranges::split_view v(input, separator);
return is_equal(v, expected);
}

template <class T, class Separator, class U, size_t M>
template <class T, class Separator, class U, std::size_t M>
constexpr bool test_with_piping(T&& input, Separator&& separator, std::array<U, M> expected) {
auto expected_it = expected.begin();
for (auto e : input | std::ranges::views::split(separator)) {
Expand Down Expand Up @@ -124,7 +124,7 @@ constexpr std::string_view sv(T&& str) {
return std::string_view(str);
};

template <class T, class Separator, class U, size_t M>
template <class T, class Separator, class U, std::size_t M>
constexpr void test_one(T&& input, Separator&& separator, std::array<U, M> expected) {
assert(test_function_call(input, separator, expected));
assert(test_with_piping(input, separator, expected));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
struct NonCommonSimpleView : std::ranges::view_base {
int* begin() const;
sentinel_wrapper<int*> end() const;
size_t size() { return 0; } // deliberately non-const
std::size_t size() { return 0; } // deliberately non-const
};
static_assert(std::ranges::sized_range<NonCommonSimpleView>);
static_assert(!std::ranges::sized_range<const NonCommonSimpleView>);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ auto toUpper(R range) {
return std::ranges::transform_view(range, [](char c) { return std::toupper(c); });
}

template<class E1, class E2, size_t N, class Join = std::plus<E1>>
template<class E1, class E2, std::size_t N, class Join = std::plus<E1>>
auto joinArrays(E1 (&a)[N], E2 (&b)[N], Join join = Join()) {
return std::ranges::transform_view(a, [&a, &b, join](auto& x) {
auto idx = (&x) - a;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#ifndef TEST_STD_RANGES_RANGE_ADAPTORS_RANGE_TRANSFORM_TYPES_H
#define TEST_STD_RANGES_RANGE_ADAPTORS_RANGE_TRANSFORM_TYPES_H

#include <cstddef>

#include "test_macros.h"
#include "test_iterators.h"
#include "test_range.h"
Expand Down Expand Up @@ -106,7 +108,7 @@ constexpr bool operator==(int* lhs, const RandomAccessIter &rhs) { return base(r
struct SizedSentinelNotConstView : std::ranges::view_base {
ForwardIter begin() const;
int *end() const;
size_t size();
std::size_t size();
};
// TODO: remove these bogus operators
bool operator==(const ForwardIter &lhs, int* rhs);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,36 +20,36 @@ constexpr bool test() {
auto sv = std::ranges::single_view<int>(42);
assert(sv.size() == 1);

ASSERT_SAME_TYPE(decltype(sv.size()), size_t);
ASSERT_SAME_TYPE(decltype(sv.size()), std::size_t);
static_assert(noexcept(sv.size()));
}
{
const auto sv = std::ranges::single_view<int>(42);
assert(sv.size() == 1);

ASSERT_SAME_TYPE(decltype(sv.size()), size_t);
ASSERT_SAME_TYPE(decltype(sv.size()), std::size_t);
static_assert(noexcept(sv.size()));
}
{
auto sv = std::ranges::single_view<int>(42);
assert(std::ranges::size(sv) == 1);

ASSERT_SAME_TYPE(decltype(std::ranges::size(sv)), size_t);
ASSERT_SAME_TYPE(decltype(std::ranges::size(sv)), std::size_t);
static_assert(noexcept(std::ranges::size(sv)));
}
{
const auto sv = std::ranges::single_view<int>(42);
assert(std::ranges::size(sv) == 1);

ASSERT_SAME_TYPE(decltype(std::ranges::size(sv)), size_t);
ASSERT_SAME_TYPE(decltype(std::ranges::size(sv)), std::size_t);
static_assert(noexcept(std::ranges::size(sv)));
}

// Test that it's static.
{
assert(std::ranges::single_view<int>::size() == 1);

ASSERT_SAME_TYPE(decltype(std::ranges::single_view<int>::size()), size_t);
ASSERT_SAME_TYPE(decltype(std::ranges::single_view<int>::size()), std::size_t);
static_assert(noexcept(std::ranges::single_view<int>::size()));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ static_assert( std::is_constructible_v<SizedSentinelForwardSubrange, Conditional
static_assert(!std::is_constructible_v<SizedSentinelForwardSubrange, Empty, ConditionallyConvertibleIter, ConditionallyConvertibleIter::udifference_type>); // 1.
static_assert( std::is_constructible_v<ConvertibleSizedSentinelForwardSubrange, ConvertibleSizedSentinelForwardIter, int*, ConvertibleSizedSentinelForwardIter::udifference_type>); // 2.
static_assert( std::is_constructible_v<SizedSentinelForwardSubrange, ConditionallyConvertibleIter, ConditionallyConvertibleIter, ConditionallyConvertibleIter::udifference_type>); // 3. (Same as default case.)
static_assert(!std::is_constructible_v<SizedIntPtrSubrange, long*, int*, size_t>); // 4.
static_assert( std::is_constructible_v<SizedIntPtrSubrange, int*, int*, size_t>); // 5.
static_assert(!std::is_constructible_v<SizedIntPtrSubrange, long*, int*, std::size_t>); // 4.
static_assert( std::is_constructible_v<SizedIntPtrSubrange, int*, int*, std::size_t>); // 5.

constexpr bool test() {
SizedSentinelForwardSubrange a(ConditionallyConvertibleIter(globalBuff), ConditionallyConvertibleIter(globalBuff + 8), 8);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
#include "test_macros.h"
#include "test_iterators.h"

template<size_t I, class S>
template<std::size_t I, class S>
concept HasGet = requires {
std::get<I>(std::declval<S>());
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ struct DifferentSentinelWithSizeMember {

constexpr ForwardIter begin() const { return ForwardIter(globalBuff); }
constexpr sentinel end() const { return sentinel{globalBuff + 8}; }
constexpr size_t size() const { return 8; }
constexpr std::size_t size() const { return 8; }
};

template<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ struct SizeIsTen : std::ranges::view_interface<SizeIsTen> {
int buff[8] = {0, 1, 2, 3, 4, 5, 6, 7};
constexpr ForwardIter begin() const { return ForwardIter(const_cast<int*>(buff)); }
constexpr ForwardIter end() const { return ForwardIter(const_cast<int*>(buff) + 8); }
constexpr size_t size() const { return 10; }
constexpr std::size_t size() const { return 10; }
};
static_assert(std::ranges::view<SizeIsTen>);

Expand Down Expand Up @@ -262,7 +262,7 @@ constexpr bool testSize() {
}

template<class T>
concept SubscriptInvocable = requires (T const& obj, size_t n) { obj[n]; };
concept SubscriptInvocable = requires (T const& obj, std::size_t n) { obj[n]; };

constexpr bool testSubscript() {
static_assert(!SubscriptInvocable<ForwardRange>);
Expand Down
8 changes: 4 additions & 4 deletions libcxx/test/std/re/re.alg/re.alg.match/awk.locale.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<char>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -60,7 +60,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<char>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -87,7 +87,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -103,7 +103,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand Down
70 changes: 35 additions & 35 deletions libcxx/test/std/re/re.alg/re.alg.match/awk.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<char>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -275,7 +275,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<char>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -290,7 +290,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<char>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand Down Expand Up @@ -323,7 +323,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<char>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -338,7 +338,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<char>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -353,7 +353,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<char>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -375,7 +375,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<char>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -391,7 +391,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<char>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -407,7 +407,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<char>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 4);
Expand All @@ -431,7 +431,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<char>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand Down Expand Up @@ -516,7 +516,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<char>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -539,7 +539,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<char>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand Down Expand Up @@ -569,7 +569,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<char>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -585,7 +585,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<char>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -601,7 +601,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<char>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand Down Expand Up @@ -643,7 +643,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == 4);
assert((std::size_t)m.length(0) == 4);
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -659,7 +659,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == s + std::char_traits<char>::length(s));
assert((size_t)m.length(0) == std::char_traits<char>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -677,7 +677,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == s+1);
assert((size_t)m.length(0) == 1);
assert((std::size_t)m.length(0) == 1);
assert(m.position(0) == 0);
assert(m.str(0) == L"a");
}
Expand All @@ -692,7 +692,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == s+2);
assert((size_t)m.length(0) == 2);
assert((std::size_t)m.length(0) == 2);
assert(m.position(0) == 0);
assert(m.str(0) == L"ab");
}
Expand Down Expand Up @@ -902,7 +902,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -917,7 +917,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -932,7 +932,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand Down Expand Up @@ -965,7 +965,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -980,7 +980,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -995,7 +995,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -1017,7 +1017,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -1033,7 +1033,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -1049,7 +1049,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
assert(m.length(1) == 4);
Expand All @@ -1073,7 +1073,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand Down Expand Up @@ -1158,7 +1158,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -1181,7 +1181,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand Down Expand Up @@ -1211,7 +1211,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -1227,7 +1227,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -1243,7 +1243,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand Down Expand Up @@ -1301,7 +1301,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == s + std::char_traits<wchar_t>::length(s));
assert((size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert((std::size_t)m.length(0) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand Down
8 changes: 4 additions & 4 deletions libcxx/test/std/re/re.alg/re.alg.match/basic.locale.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -62,7 +62,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<char>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -89,7 +89,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand All @@ -105,7 +105,7 @@ int main(int, char**)
assert(!m.suffix().matched);
assert(m.suffix().first == m[0].second);
assert(m.suffix().second == m[0].second);
assert(m.length(0) >= 0 && static_cast<size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.length(0) >= 0 && static_cast<std::size_t>(m.length(0)) == std::char_traits<wchar_t>::length(s));
assert(m.position(0) == 0);
assert(m.str(0) == s);
}
Expand Down
Loading