00001 // (C) Copyright David Abrahams 2001. 00002 // Distributed under the Boost Software License, Version 1.0. (See 00003 // accompanying file LICENSE_1_0.txt or copy at 00004 // http://www.boost.org/LICENSE_1_0.txt) 00005 // 00006 // See http://www.boost.org for most recent version including documentation. 00007 00008 // Revision History 00009 // 09 Feb 01 Applied John Maddock's Borland patch Moving <true> 00010 // specialization to unspecialized template (David Abrahams) 00011 // 06 Feb 01 Created (David Abrahams) 00012 00013 #ifndef SELECT_TYPE_DWA20010206_HPP 00014 # define SELECT_TYPE_DWA20010206_HPP 00015 00016 namespace boost { namespace detail { 00017 00018 // Template class if_true -- select among 2 types based on a bool constant expression 00019 // Usage: 00020 // typename if_true<(bool_const_expression)>::template then<true_type, false_type>::type 00021 00022 // HP aCC cannot deal with missing names for template value parameters 00023 template <bool b> struct if_true 00024 { 00025 template <class T, class F> 00026 struct then { typedef T type; }; 00027 }; 00028 00029 template <> 00030 struct if_true<false> 00031 { 00032 template <class T, class F> 00033 struct then { typedef F type; }; 00034 }; 00035 }} 00036 #endif // SELECT_TYPE_DWA20010206_HPP