explicit-size type aliases + do not expose uint etc into global namespace

master
Daniel Kolesa 2015-06-08 20:45:49 +01:00
parent d4e234f893
commit 06dc966f19
2 changed files with 52 additions and 12 deletions

View File

@ -646,19 +646,19 @@ template<typename T > struct IsSame<T, T>: True {};
/* extent */
template<typename T, unsigned I = 0>
template<typename T, uint I = 0>
struct Extent: IntegralConstant<size_t, 0> {};
template<typename T>
struct Extent<T[], 0>: IntegralConstant<size_t, 0> {};
template<typename T, unsigned I>
template<typename T, uint I>
struct Extent<T[], I>: IntegralConstant<size_t, Extent<T, I - 1>::value> {};
template<typename T, size_t N>
struct Extent<T[N], 0>: IntegralConstant<size_t, N> {};
template<typename T, size_t N, unsigned I>
template<typename T, size_t N, uint I>
struct Extent<T[N], I>: IntegralConstant<size_t, Extent<T, I - 1>::value> {};
/* rank */

View File

@ -11,6 +11,8 @@
namespace octa {
/* "builtin" types */
using schar = signed char;
using uchar = unsigned char;
using ushort = unsigned short;
@ -21,23 +23,61 @@ using llong = long long;
using ldouble = long double;
/* nullptr type */
using Nullptr = decltype(nullptr);
/* max align */
#if defined(__CLANG_MAX_ALIGN_T_DEFINED) || defined(_GCC_MAX_ALIGN_T)
using MaxAlign = ::max_align_t;
#else
using MaxAlign = long double;
#endif
/* stddef */
using Ptrdiff = ptrdiff_t;
using Size = size_t;
/* stdint */
using Intmax = intmax_t;
using Uintmax = uintmax_t;
using Intptr = intptr_t;
using Uintptr = uintptr_t;
using Int8 = int8_t;
using Int16 = int16_t;
using Int32 = int32_t;
using Int64 = int64_t;
using Uint8 = uint8_t;
using Uint16 = uint16_t;
using Uint32 = uint32_t;
using Uint64 = uint64_t;
using IntLeast8 = int_least8_t;
using IntLeast16 = int_least16_t;
using IntLeast32 = int_least32_t;
using IntLeast64 = int_least64_t;
using UintLeast8 = uint_least8_t;
using UintLeast16 = uint_least16_t;
using UintLeast32 = uint_least32_t;
using UintLeast64 = uint_least64_t;
using IntFast8 = int_fast8_t;
using IntFast16 = int_fast16_t;
using IntFast32 = int_fast32_t;
using IntFast64 = int_fast64_t;
using UintFast8 = uint_fast8_t;
using UintFast16 = uint_fast16_t;
using UintFast32 = uint_fast32_t;
using UintFast64 = uint_fast64_t;
}
using octa::schar;
using octa::uchar;
using octa::ushort;
using octa::uint;
using octa::ulong;
using octa::ullong;
using octa::llong;
using octa::ldouble;
#endif