• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1////
2Copyright 2017 Peter Dimov
3
4Distributed under the Boost Software License, Version 1.0.
5
6See accompanying file LICENSE_1_0.txt or copy at
7http://www.boost.org/LICENSE_1_0.txt
8////
9
10[#integral]
11# Integral Constants, <boost/mp11/integral.hpp>
12:toc:
13:toc-title:
14:idprefix:
15
16For an Mp11 integral constant type `T`, `T::value` is an integral constant in the C++ sense.
17
18## mp_bool<B>
19
20    template<bool B> using mp_bool = std::integral_constant<bool, B>;
21
22Same as `std::bool_constant` in C++17.
23
24## mp_true
25
26    using mp_true = mp_bool<true>;
27
28Same as `std::true_type`.
29
30## mp_false
31
32    using mp_false = mp_bool<false>;
33
34Same as `std::false_type`.
35
36## mp_to_bool<T>
37
38    template<class T> using mp_to_bool = mp_bool<static_cast<bool>(T::value)>;
39
40## mp_not<T>
41
42    template<class T> using mp_not = mp_bool< !T::value >;
43
44## mp_int<I>
45
46    template<int I> using mp_int = std::integral_constant<int, I>;
47
48## mp_size_t<N>
49
50    template<std::size_t N> using mp_size_t = std::integral_constant<std::size_t, N>;
51