blob: 663ff08efb95a72bce6e4e26451578258a03c977 [file] [log] [blame]
Brian Silverman4a2409e2018-08-04 23:24:02 -07001[/
2 Copyright 2007 John Maddock.
3 Distributed under the Boost Software License, Version 1.0.
4 (See accompanying file LICENSE_1_0.txt or copy at
5 http://www.boost.org/LICENSE_1_0.txt).
6]
7
8[section:integral_constant integral_constant]
9 template <class T, T val>
10 struct integral_constant
11 {
12 typedef integral_constant<T, val> type;
13 typedef T value_type;
14 static const T value = val;
15 constexpr operator T()const;
16 };
17
18 typedef integral_constant<bool, true> true_type;
19 typedef integral_constant<bool, false> false_type;
20
21Class template `integral_constant` is the common base class for all the value-based
22type traits. The two typedef's `true_type` and `false_type` are provided for
23convenience: most of the value traits are Boolean properties and so will inherit from
24one of these.
25
26[endsect]
27