]>
Commit | Line | Data |
---|---|---|
7c673cae FG |
1 | [#boxed_value] |
2 | [section Boxed value] | |
3 | ||
4 | A ['boxed value] is a type representing a constant value. It has a public static | |
5 | `const` or `constexpr` member called `value`. The class represents that value as | |
6 | a type, so it can be manipulated by [link metafunction template metafunction]s. | |
7 | It has to be a [link metaprogramming_value template metaprogramming value]. | |
8 | ||
9 | For example the following `struct` represents the `true` value of type `bool`: | |
10 | ||
11 | struct true_type | |
12 | { | |
13 | static constexpr bool value = true; | |
14 | using type = true_type; | |
15 | }; | |
16 | ||
17 | The `value` member is the wrapped value. `true_type::type` is an alias of | |
18 | `true_type` which makes it a template metaprogramming value. | |
19 | ||
20 | [endsect] | |
21 |