cppx-core
Int_.hpp
Go to the documentation of this file.
1 #pragma once // Source encoding: UTF-8 with BOM (π is a lowercase Greek "pi").
2 
7 #include <cppx-core/language/types/type-makers.hpp> // cppx::Unsigned_
8 #include <c/stdint.hpp> // ::intN_t
9 
10 namespace cppx
11 {
12  namespace impl
13  {
14  template< int n_bits > struct Int_t_;
15 
16  template<> struct Int_t_<8>{ using T = int8_t; };
17  template<> struct Int_t_<16>{ using T = int16_t; };
18  template<> struct Int_t_<32>{ using T = int32_t; };
19  template<> struct Int_t_<64>{ using T = int64_t; };
20  } // namespace impl
21 
22  // The Doxygen \hideinitializer command doesn't work here, so.
25  #ifdef DOXYGEN
26  template< int n_bits > using Int_ = ...;
27  #else
28  template< int n_bits > using Int_ = typename impl::Int_t_<n_bits>::T;
29  #endif
30 
32  template< int n_bits > using Unsigned_int_ = Unsigned_<Int_<n_bits>>;
33 
34 } // namespace cppx
std::make_unsigned_t< Integer > Unsigned_
For an integer type, produces the corresponding unsigned type.
Definition: type-makers.hpp:49
Type_choice_, Unptr_, Unref_, Signed_, Unsigned_, Const_, Unconst_ and Array_of_.
Unsigned_< Int_< n_bits > > Unsigned_int_
Unsigned integer types parameterized by exact width in bits.
Definition: Int_.hpp:32
... Int_
Signed integer types parameterized by exact width in bits.
Definition: Int_.hpp:26