fix doc example typo
[boost.git] / boost / detail / select_type.hpp
blobc13946f3384bdb773d2ced5faa683b2dd6a670ca
1 // (C) Copyright David Abrahams 2001.
2 // Distributed under the Boost Software License, Version 1.0. (See
3 // accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
5 //
6 // See http://www.boost.org for most recent version including documentation.
8 // Revision History
9 // 09 Feb 01 Applied John Maddock's Borland patch Moving <true>
10 // specialization to unspecialized template (David Abrahams)
11 // 06 Feb 01 Created (David Abrahams)
13 #ifndef SELECT_TYPE_DWA20010206_HPP
14 # define SELECT_TYPE_DWA20010206_HPP
16 namespace boost { namespace detail {
18 // Template class if_true -- select among 2 types based on a bool constant expression
19 // Usage:
20 // typename if_true<(bool_const_expression)>::template then<true_type, false_type>::type
22 // HP aCC cannot deal with missing names for template value parameters
23 template <bool b> struct if_true
25 template <class T, class F>
26 struct then { typedef T type; };
29 template <>
30 struct if_true<false>
32 template <class T, class F>
33 struct then { typedef F type; };
36 #endif // SELECT_TYPE_DWA20010206_HPP