mn_inttokey.hpp
Go to the documentation of this file.
1 /*
2 *This file is part of the Mini Thread Library (https://github.com/RoseLeBlood/MiniThread ).
3 *Copyright (c) 2021 Amber-Sophia Schroeck
4 *
5 *The Mini Thread Library is free software; you can redistribute it and/or modify
6 *it under the terms of the GNU Lesser General Public License as published by
7 *the Free Software Foundation, version 3, or (at your option) any later version.
8 
9 *The Mini Thread Library is distributed in the hope that it will be useful, but
10 *WITHOUT ANY WARRANTY; without even the implied warranty of
11 *MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 *General Public License for more details.
13 *
14 *You should have received a copy of the GNU Lesser General Public
15 *License along with the Mini Thread Library; if not, see
16 *<https://www.gnu.org/licenses/>.
17 */
18 #ifndef _MINLIB_INT2KEY_H_
19 #define _MINLIB_INT2KEY_H_
20 
21 #include <stddef.h>
22 #include <stdint.h>
23 
24 namespace mn {
25  template<int TVal> struct int_to_type {
26  enum { value = TVal };
27  };
28 
29  template <typename T>
30  struct type_to_type {
31  using orig_type = T;
32  };
33 
34  template <bool flag, typename T, typename U>
35  struct select {
36  using result = T;
37  };
38 
39  template <typename T, typename U>
40  struct select<false, T, U> {
41  using result = U;
42  };
43 
44 
45 }
46 
47 #endif
struct mn::memory::detail::ptr_difference T
Definition: mn_atomic_singleton.hpp:38
Definition: mn_allocator_typetraits.hpp:25
T orig_type
Definition: mn_inttokey.hpp:31
T result
Definition: mn_inttokey.hpp:36
U result
Definition: mn_inttokey.hpp:41
Definition: mn_inttokey.hpp:35
Definition: mn_inttokey.hpp:30
Definition: mn_inttokey.hpp:25
@ value
Definition: mn_inttokey.hpp:26