]> git.lyx.org Git - lyx.git/blob - boost/boost/detail/select_type.hpp
major boost update
[lyx.git] / boost / boost / detail / select_type.hpp
1 // (C) Copyright David Abrahams 2001. Permission to copy, use, modify,
2 // sell and distribute this software is granted provided this
3 // copyright notice appears in all copies. This software is provided
4 // "as is" without express or implied warranty, and with no claim as
5 // to its suitability for any purpose.
6 //
7 // See http://www.boost.org for most recent version including documentation.
8
9 // Revision History
10 // 09 Feb 01  Applied John Maddock's Borland patch Moving <true>
11 //            specialization to unspecialized template (David Abrahams)
12 // 06 Feb 01  Created (David Abrahams)
13
14 #ifndef SELECT_TYPE_DWA20010206_HPP
15 # define SELECT_TYPE_DWA20010206_HPP
16
17 namespace boost { namespace detail {
18
19   // Template class if_true -- select among 2 types based on a bool constant expression
20   // Usage:
21   //   typename if_true<(bool_const_expression)>::template then<true_type, false_type>::type
22
23   // HP aCC cannot deal with missing names for template value parameters
24   template <bool b> struct if_true
25   {
26       template <class T, class F>
27       struct then { typedef T type; };
28   };
29
30   template <>
31   struct if_true<false>
32   {
33       template <class T, class F>
34       struct then { typedef F type; };
35   };
36 }}
37 #endif // SELECT_TYPE_DWA20010206_HPP