Brian Silverman | 4a2409e | 2018-08-04 23:24:02 -0700 | [diff] [blame^] | 1 | [/ |
| 2 | Copyright 2010 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 | [/===================================================================] |
| 9 | [section:conditional conditional] |
| 10 | [/===================================================================] |
| 11 | |
| 12 | |
| 13 | __header ` #include <boost/type_traits/conditional.hpp>` or ` #include <boost/type_traits.hpp>` |
| 14 | |
| 15 | namespace boost { |
| 16 | template <bool B, class T, class U> struct __conditional; |
| 17 | template <bool B, class T, class U> using conditional_t = typename conditional<B, T, U>::type; // C++11 and above |
| 18 | } |
| 19 | |
| 20 | If B is true, the member typedef type shall equal T. If B is false, the member typedef type shall equal U. |
| 21 | |
| 22 | [endsect] |
| 23 | |