conditional.qbk 801 B

1234567891011121314151617181920212223
  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. [section:conditional conditional]
  9. [/===================================================================]
  10. __header ` #include <boost/type_traits/conditional.hpp>` or ` #include <boost/type_traits.hpp>`
  11. namespace boost {
  12. template <bool B, class T, class U> struct __conditional;
  13. template <bool B, class T, class U> using conditional_t = typename conditional<B, T, U>::type; // C++11 and above
  14. }
  15. If B is true, the member typedef type shall equal T. If B is false, the member typedef type shall equal U.
  16. [endsect]