summaryrefslogtreecommitdiff
path: root/test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'test.cc')
-rw-r--r--test.cc157
1 files changed, 79 insertions, 78 deletions
diff --git a/test.cc b/test.cc
index b008006..4d8ad85 100644
--- a/test.cc
+++ b/test.cc
@@ -32,7 +32,7 @@ static_assert(::zp::isptr<int volatile * const volatile>::val == true);
static_assert(::zp::isptr<int const volatile * const volatile>::val == true);
static_assert(::zp::typequ<int,int>::val == true);
-static_assert(::zp::typequ<int,long>::val == false);
+static_assert(::zp::typequ<int,int long>::val == false);
static_assert(::zp::typequ<::zp::i8, ::std::uint8_t>::val == true);
static_assert(::zp::typequ<::zp::i8s, ::std::int8_t>::val == true);
@@ -43,8 +43,9 @@ static_assert(::zp::typequ<::zp::i02s,::std::int32_t>::val == true);
static_assert(::zp::typequ<::zp::i04, ::std::uint64_t>::val == true);
static_assert(::zp::typequ<::zp::i04s,::std::int64_t>::val == true);
-static_assert(::zp::typequ<::zp::intptr,::std::uintptr_t>::val == true);
-static_assert(::zp::typequ<::zp::siz, ::std::size_t>::val == true);
+static_assert(::zp::typequ<::zp::ptr, ::std::uintptr_t>::val == true);
+static_assert(::zp::typequ<::zp::ptrdif,::std::ptrdiff_t>::val == true);
+static_assert(::zp::typequ<::zp::siz, ::std::size_t>::val == true);
static_assert(::zp::typequ<::zp::remref<int>::typ, int>::val == true);
static_assert(::zp::typequ<::zp::remref<int &>::typ,int>::val == true);
@@ -80,84 +81,84 @@ static_assert(::zp::typequ<::zp::usgn<int const volatile>::typ, int unsi
static_assert(::zp::typequ<::zp::nulptrtyp,::std::nullptr_t>::val == true);
-static_assert(::zp::isusgn<char>::val == ::std::is_unsigned<char>::value);
-static_assert(::zp::isusgn<char16_t>::val == ::std::is_unsigned<char16_t>::value);
-static_assert(::zp::isusgn<char32_t>::val == ::std::is_unsigned<char32_t>::value);
-static_assert(::zp::isusgn<::zp::c8>::val == ::std::is_unsigned<::zp::c8>::value);
-static_assert(::zp::isusgn<double>::val == ::std::is_unsigned<double>::value);
-static_assert(::zp::isusgn<float>::val == ::std::is_unsigned<float>::value);
-static_assert(::zp::isusgn<int>::val == ::std::is_unsigned<int>::value);
-static_assert(::zp::isusgn<long>::val == ::std::is_unsigned<long>::value);
-static_assert(::zp::isusgn<double long>::val == ::std::is_unsigned<double long>::value);
-static_assert(::zp::isusgn<long long>::val == ::std::is_unsigned<long long>::value);
-static_assert(::zp::isusgn<short>::val == ::std::is_unsigned<short>::value);
-static_assert(::zp::isusgn<char signed>::val == ::std::is_unsigned<char signed>::value);
-static_assert(::zp::isusgn<char unsigned>::val == ::std::is_unsigned<char unsigned>::value);
-static_assert(::zp::isusgn<int unsigned>::val == ::std::is_unsigned<int unsigned>::value);
-static_assert(::zp::isusgn<long unsigned>::val == ::std::is_unsigned<long unsigned>::value);
-static_assert(::zp::isusgn<long long unsigned>::val == ::std::is_unsigned<long long unsigned>::value);
-static_assert(::zp::isusgn<short unsigned>::val == ::std::is_unsigned<short unsigned>::value);
-static_assert(::zp::isusgn<wchar_t>::val == ::std::is_unsigned<wchar_t>::value);
-
-static_assert(::zp::issgn<char>::val == ::std::is_signed<char>::value);
-static_assert(::zp::issgn<double>::val == ::std::is_signed<double>::value);
-static_assert(::zp::issgn<float>::val == ::std::is_signed<float>::value);
-static_assert(::zp::issgn<int>::val == ::std::is_signed<int>::value);
-static_assert(::zp::issgn<long>::val == ::std::is_signed<long>::value);
-static_assert(::zp::issgn<double long>::val == ::std::is_signed<double long>::value);
-static_assert(::zp::issgn<long long>::val == ::std::is_signed<long long>::value);
-static_assert(::zp::issgn<short>::val == ::std::is_signed<short>::value);
-static_assert(::zp::issgn<char signed>::val == ::std::is_signed<char signed>::value);
-static_assert(::zp::issgn<char unsigned>::val == ::std::is_signed<char unsigned>::value);
-static_assert(::zp::issgn<int unsigned>::val == ::std::is_signed<int unsigned>::value);
-static_assert(::zp::issgn<long unsigned>::val == ::std::is_signed<long unsigned>::value);
-static_assert(::zp::issgn<long long unsigned>::val == ::std::is_signed<long long unsigned>::value);
-static_assert(::zp::issgn<short unsigned>::val == ::std::is_signed<short unsigned>::value);
-static_assert(::zp::issgn<wchar_t>::val == ::std::is_signed<wchar_t>::value);
+static_assert(::zp::isusgn<char>::val == ::std::is_unsigned<char>::value);
+static_assert(::zp::isusgn<char16_t>::val == ::std::is_unsigned<char16_t>::value);
+static_assert(::zp::isusgn<char32_t>::val == ::std::is_unsigned<char32_t>::value);
+static_assert(::zp::isusgn<::zp::c8>::val == ::std::is_unsigned<::zp::c8>::value);
+static_assert(::zp::isusgn<double>::val == ::std::is_unsigned<double>::value);
+static_assert(::zp::isusgn<float>::val == ::std::is_unsigned<float>::value);
+static_assert(::zp::isusgn<int>::val == ::std::is_unsigned<int>::value);
+static_assert(::zp::isusgn<int long>::val == ::std::is_unsigned<int long>::value);
+static_assert(::zp::isusgn<double long>::val == ::std::is_unsigned<double long>::value);
+static_assert(::zp::isusgn<int long long>::val == ::std::is_unsigned<int long long>::value);
+static_assert(::zp::isusgn<short>::val == ::std::is_unsigned<short>::value);
+static_assert(::zp::isusgn<char signed>::val == ::std::is_unsigned<char signed>::value);
+static_assert(::zp::isusgn<char unsigned>::val == ::std::is_unsigned<char unsigned>::value);
+static_assert(::zp::isusgn<int unsigned>::val == ::std::is_unsigned<int unsigned>::value);
+static_assert(::zp::isusgn<int long unsigned>::val == ::std::is_unsigned<int long unsigned>::value);
+static_assert(::zp::isusgn<int long long unsigned>::val == ::std::is_unsigned<int long long unsigned>::value);
+static_assert(::zp::isusgn<short unsigned>::val == ::std::is_unsigned<short unsigned>::value);
+static_assert(::zp::isusgn<wchar_t>::val == ::std::is_unsigned<wchar_t>::value);
+
+static_assert(::zp::issgn<char>::val == ::std::is_signed<char>::value);
+static_assert(::zp::issgn<double>::val == ::std::is_signed<double>::value);
+static_assert(::zp::issgn<float>::val == ::std::is_signed<float>::value);
+static_assert(::zp::issgn<int>::val == ::std::is_signed<int>::value);
+static_assert(::zp::issgn<int long>::val == ::std::is_signed<int long>::value);
+static_assert(::zp::issgn<double long>::val == ::std::is_signed<double long>::value);
+static_assert(::zp::issgn<int long long>::val == ::std::is_signed<int long long>::value);
+static_assert(::zp::issgn<short>::val == ::std::is_signed<short>::value);
+static_assert(::zp::issgn<char signed>::val == ::std::is_signed<char signed>::value);
+static_assert(::zp::issgn<char unsigned>::val == ::std::is_signed<char unsigned>::value);
+static_assert(::zp::issgn<int unsigned>::val == ::std::is_signed<int unsigned>::value);
+static_assert(::zp::issgn<int long unsigned>::val == ::std::is_signed<int long unsigned>::value);
+static_assert(::zp::issgn<int long long unsigned>::val == ::std::is_signed<int long long unsigned>::value);
+static_assert(::zp::issgn<short unsigned>::val == ::std::is_signed<short unsigned>::value);
+static_assert(::zp::issgn<wchar_t>::val == ::std::is_signed<wchar_t>::value);
static_assert(::zp::bytelen == CHAR_BIT);
-static_assert(::zp::minval<bool>::val == ::std::numeric_limits<bool>::lowest());
-static_assert(::zp::minval<char>::val == ::std::numeric_limits<char>::lowest());
-static_assert(::zp::minval<char16_t>::val == ::std::numeric_limits<char16_t>::lowest());
-static_assert(::zp::minval<char32_t>::val == ::std::numeric_limits<char32_t>::lowest());
-static_assert(::zp::minval<::zp::c8>::val == ::std::numeric_limits<::zp::c8>::lowest());
-static_assert(::zp::minval<double>::val == ::std::numeric_limits<double>::lowest());
-static_assert(::zp::minval<float>::val == ::std::numeric_limits<float>::lowest());
-static_assert(::zp::minval<int>::val == ::std::numeric_limits<int>::lowest());
-static_assert(::zp::minval<long>::val == ::std::numeric_limits<long>::lowest());
-static_assert(::zp::minval<double long>::val == ::std::numeric_limits<double long>::lowest());
-static_assert(::zp::minval<long long>::val == ::std::numeric_limits<long long>::lowest());
-static_assert(::zp::minval<short>::val == ::std::numeric_limits<short>::lowest());
-static_assert(::zp::minval<char signed>::val == ::std::numeric_limits<char signed>::lowest());
-static_assert(::zp::minval<char unsigned>::val == ::std::numeric_limits<char unsigned>::lowest());
-static_assert(::zp::minval<short unsigned>::val == ::std::numeric_limits<short unsigned>::lowest());
-static_assert(::zp::minval<int unsigned>::val == ::std::numeric_limits<int unsigned>::lowest());
-static_assert(::zp::minval<long unsigned>::val == ::std::numeric_limits<long unsigned>::lowest());
-static_assert(::zp::minval<long long unsigned>::val == ::std::numeric_limits<long long unsigned>::lowest());
-static_assert(::zp::minval<wchar_t>::val == ::std::numeric_limits<wchar_t>::lowest());
-
-static_assert(::zp::maxval<bool>::val == ::std::numeric_limits<bool>::max());
-static_assert(::zp::maxval<char>::val == ::std::numeric_limits<char>::max());
-static_assert(::zp::maxval<char16_t>::val == ::std::numeric_limits<char16_t>::max());
-static_assert(::zp::maxval<char32_t>::val == ::std::numeric_limits<char32_t>::max());
-static_assert(::zp::maxval<::zp::c8>::val == ::std::numeric_limits<::zp::c8>::max());
-static_assert(::zp::maxval<double>::val == ::std::numeric_limits<double>::max());
-static_assert(::zp::maxval<float>::val == ::std::numeric_limits<float>::max());
-static_assert(::zp::maxval<int>::val == ::std::numeric_limits<int>::max());
-static_assert(::zp::maxval<long>::val == ::std::numeric_limits<long>::max());
-static_assert(::zp::maxval<double long>::val == ::std::numeric_limits<double long>::max());
-static_assert(::zp::maxval<long long>::val == ::std::numeric_limits<long long>::max());
-static_assert(::zp::maxval<short>::val == ::std::numeric_limits<short>::max());
-static_assert(::zp::maxval<char signed>::val == ::std::numeric_limits<char signed>::max());
-static_assert(::zp::maxval<char unsigned>::val == ::std::numeric_limits<char unsigned>::max());
-static_assert(::zp::maxval<short unsigned>::val == ::std::numeric_limits<short unsigned>::max());
-static_assert(::zp::maxval<int unsigned>::val == ::std::numeric_limits<int unsigned>::max());
-static_assert(::zp::maxval<long unsigned>::val == ::std::numeric_limits<long unsigned>::max());
-static_assert(::zp::maxval<long long unsigned>::val == ::std::numeric_limits<long long unsigned>::max());
-static_assert(::zp::maxval<wchar_t>::val == ::std::numeric_limits<wchar_t>::max());
-
-template<typename ltyp,typename rtyp> static auto cmp(int unsigned & numerr,long const ln,ltyp const & lvalref,rtyp const & rvalref) noexcept {
+static_assert(::zp::minval<bool>::val == ::std::numeric_limits<bool>::lowest());
+static_assert(::zp::minval<char>::val == ::std::numeric_limits<char>::lowest());
+static_assert(::zp::minval<char16_t>::val == ::std::numeric_limits<char16_t>::lowest());
+static_assert(::zp::minval<char32_t>::val == ::std::numeric_limits<char32_t>::lowest());
+static_assert(::zp::minval<::zp::c8>::val == ::std::numeric_limits<::zp::c8>::lowest());
+static_assert(::zp::minval<double>::val == ::std::numeric_limits<double>::lowest());
+static_assert(::zp::minval<float>::val == ::std::numeric_limits<float>::lowest());
+static_assert(::zp::minval<int>::val == ::std::numeric_limits<int>::lowest());
+static_assert(::zp::minval<int long>::val == ::std::numeric_limits<int long>::lowest());
+static_assert(::zp::minval<double long>::val == ::std::numeric_limits<double long>::lowest());
+static_assert(::zp::minval<int long long>::val == ::std::numeric_limits<int long long>::lowest());
+static_assert(::zp::minval<short>::val == ::std::numeric_limits<short>::lowest());
+static_assert(::zp::minval<char signed>::val == ::std::numeric_limits<char signed>::lowest());
+static_assert(::zp::minval<char unsigned>::val == ::std::numeric_limits<char unsigned>::lowest());
+static_assert(::zp::minval<short unsigned>::val == ::std::numeric_limits<short unsigned>::lowest());
+static_assert(::zp::minval<int unsigned>::val == ::std::numeric_limits<int unsigned>::lowest());
+static_assert(::zp::minval<int long unsigned>::val == ::std::numeric_limits<int long unsigned>::lowest());
+static_assert(::zp::minval<int long long unsigned>::val == ::std::numeric_limits<int long long unsigned>::lowest());
+static_assert(::zp::minval<wchar_t>::val == ::std::numeric_limits<wchar_t>::lowest());
+
+static_assert(::zp::maxval<bool>::val == ::std::numeric_limits<bool>::max());
+static_assert(::zp::maxval<char>::val == ::std::numeric_limits<char>::max());
+static_assert(::zp::maxval<char16_t>::val == ::std::numeric_limits<char16_t>::max());
+static_assert(::zp::maxval<char32_t>::val == ::std::numeric_limits<char32_t>::max());
+static_assert(::zp::maxval<::zp::c8>::val == ::std::numeric_limits<::zp::c8>::max());
+static_assert(::zp::maxval<double>::val == ::std::numeric_limits<double>::max());
+static_assert(::zp::maxval<float>::val == ::std::numeric_limits<float>::max());
+static_assert(::zp::maxval<int>::val == ::std::numeric_limits<int>::max());
+static_assert(::zp::maxval<int long>::val == ::std::numeric_limits<int long>::max());
+static_assert(::zp::maxval<double long>::val == ::std::numeric_limits<double long>::max());
+static_assert(::zp::maxval<int long long>::val == ::std::numeric_limits<int long long>::max());
+static_assert(::zp::maxval<short>::val == ::std::numeric_limits<short>::max());
+static_assert(::zp::maxval<char signed>::val == ::std::numeric_limits<char signed>::max());
+static_assert(::zp::maxval<char unsigned>::val == ::std::numeric_limits<char unsigned>::max());
+static_assert(::zp::maxval<short unsigned>::val == ::std::numeric_limits<short unsigned>::max());
+static_assert(::zp::maxval<int unsigned>::val == ::std::numeric_limits<int unsigned>::max());
+static_assert(::zp::maxval<int long unsigned>::val == ::std::numeric_limits<int long unsigned>::max());
+static_assert(::zp::maxval<int long long unsigned>::val == ::std::numeric_limits<int long long unsigned>::max());
+static_assert(::zp::maxval<wchar_t>::val == ::std::numeric_limits<wchar_t>::max());
+
+template<typename ltyp,typename rtyp> static auto cmp(int unsigned & numerr,int long const ln,ltyp const & lvalref,rtyp const & rvalref) noexcept {
char const * const ltypnm = typeid (ltyp).name();
char const * const rtypnm = typeid (rtyp).name();