DxLibEx
use_big_type_when_one_byte_t.hpp
Go to the documentation of this file.
1
/*=============================================================================
2
Copyright (C) 2015-2017 DxLibEx project
3
https://github.com/Nagarei/DxLibEx/
4
5
Distributed under the Boost Software License, Version 1.0.
6
(See http://www.boost.org/LICENSE_1_0.txt)
7
=============================================================================*/
8
#ifndef DXLE_INC_BASIC_TYPES_ARTHMETIC_T_HPP_
9
#define DXLE_INC_BASIC_TYPES_ARTHMETIC_T_HPP_
10
#include "
dxlibex/type_traits/first_enabled.hpp
"
11
#include "
dxlibex/type_traits/enable_if.hpp
"
12
namespace
dxle
{
13
namespace
detail {
14
template
<
typename
T,
bool
is_arithmetic>
15
struct
use_big_type_when_one_byte_impl
{
16
using
type
= T;
17
};
18
template
<
typename
T>
19
struct
use_big_type_when_one_byte_impl
<T, true> :
first_enabled
<
20
enable_if<1 != sizeof(T), T>,
21
enable_if<std::is_signed<T>::value, int>,
22
unsigned int
23
>
24
{};
25
}
26
template
<
typename
T>
27
struct
use_big_type_when_one_byte
:
dxle::detail::use_big_type_when_one_byte_impl
<T, std::is_arithmetic<T>::value> {};
29
template
<
typename
T>
30
using
use_big_type_when_one_byte_t
=
typename
use_big_type_when_one_byte<T>::type
;
31
}
32
#endif //DXLE_INC_BASIC_TYPES_ARTHMETIC_T_HPP_
dxle::use_big_type_when_one_byte
Definition:
use_big_type_when_one_byte_t.hpp:27
dxle::type_traits::first_enabled
multi-conditional if struct for TMP. This class is used in conjunction with std::enable_if.
Definition:
first_enabled.hpp:32
dxle::use_big_type_when_one_byte_t
typename use_big_type_when_one_byte< T >::type use_big_type_when_one_byte_t
for int8_t/uint8_t
Definition:
use_big_type_when_one_byte_t.hpp:30
dxle
Definition:
cast_if.hpp:12
first_enabled.hpp
enable_if.hpp
dxle::detail::use_big_type_when_one_byte_impl< T, std::is_arithmetic< T >::value >::type
T type
Definition:
use_big_type_when_one_byte_t.hpp:16
dxle::detail::use_big_type_when_one_byte_impl
Definition:
use_big_type_when_one_byte_t.hpp:15
dxlibex
basic_types
use_big_type_when_one_byte_t.hpp
Generated on Sun Jan 1 2017 10:49:50 for DxLibEx by
1.8.12