Line |
Branch |
Exec |
Source |
1 |
|
|
/** |
2 |
|
|
* @file lib.Types.hpp |
3 |
|
|
* @author Sergey Baigudin, sergey@baigudin.software |
4 |
|
|
* @copyright 2020-2022, Sergey Baigudin, Baigudin Software |
5 |
|
|
* |
6 |
|
|
* @brief Library type definitions. |
7 |
|
|
*/ |
8 |
|
|
#ifndef LIB_TYPES_HPP_ |
9 |
|
|
#define LIB_TYPES_HPP_ |
10 |
|
|
|
11 |
|
|
#include "Types.hpp" |
12 |
|
|
|
13 |
|
|
namespace eoos |
14 |
|
|
{ |
15 |
|
|
namespace lib |
16 |
|
|
{ |
17 |
|
|
|
18 |
|
|
/** |
19 |
|
|
* @struct Number |
20 |
|
|
* @brief Number properties. |
21 |
|
|
*/ |
22 |
|
|
struct Number |
23 |
|
|
{ |
24 |
|
|
/** |
25 |
|
|
* @enum Base |
26 |
|
|
* @brief Radix or base of numbers. |
27 |
|
|
*/ |
28 |
|
|
enum Base |
29 |
|
|
{ |
30 |
|
|
BASE_2 = 2, ///< Binary system. |
31 |
|
|
BASE_8 = 8, ///< Octal system. |
32 |
|
|
BASE_10 = 10, ///< Decimal system. |
33 |
|
|
BASE_16 = 16 ///< Hexadecimal system. |
34 |
|
|
}; |
35 |
|
|
}; |
36 |
|
|
|
37 |
|
|
#if EOOS_CPP_STANDARD >= 2011 |
38 |
|
|
|
39 |
|
|
/** |
40 |
|
|
* @brief Structs to remove references. |
41 |
|
|
*/ |
42 |
|
|
template <class T> struct remove_reference {typedef T type;}; |
43 |
|
|
template <class T> struct remove_reference<T&> {typedef T type;}; |
44 |
|
|
template <class T> struct remove_reference<T&&> {typedef T type;}; |
45 |
|
|
|
46 |
|
|
/** |
47 |
|
|
* @brief Casts an object to right reference. |
48 |
|
|
*/ |
49 |
|
|
template <class T> |
50 |
|
74 |
constexpr typename remove_reference<T>::type&& move(T&& arg) noexcept |
51 |
|
|
{ |
52 |
|
74 |
return static_cast<typename remove_reference<T>::type&&>(arg); |
53 |
|
|
} |
54 |
|
|
|
55 |
|
|
#endif // EOOS_CPP_STANDARD >= 2011 |
56 |
|
|
|
57 |
|
|
} // namespace lib |
58 |
|
|
} // namespace eoos |
59 |
|
|
#endif // LIB_TYPES_HPP_ |
60 |
|
|
|