00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #ifndef BOOST_UTILITY_ENABLE_IF_HPP
00015 #define BOOST_UTILITY_ENABLE_IF_HPP
00016
00017 #include "sysc/packages/boost/config.hpp"
00018
00019
00020
00021
00022 #ifndef BOOST_NO_SFINAE
00023
00024 namespace boost
00025 {
00026
00027 template <bool B, class T = void>
00028 struct enable_if_c {
00029 typedef T type;
00030 };
00031
00032 template <class T>
00033 struct enable_if_c<false, T> {};
00034
00035 template <class Cond, class T = void>
00036 struct enable_if : public enable_if_c<Cond::value, T> {};
00037
00038 template <bool B, class T>
00039 struct lazy_enable_if_c {
00040 typedef typename T::type type;
00041 };
00042
00043 template <class T>
00044 struct lazy_enable_if_c<false, T> {};
00045
00046 template <class Cond, class T>
00047 struct lazy_enable_if : public lazy_enable_if_c<Cond::value, T> {};
00048
00049
00050 template <bool B, class T = void>
00051 struct disable_if_c {
00052 typedef T type;
00053 };
00054
00055 template <class T>
00056 struct disable_if_c<true, T> {};
00057
00058 template <class Cond, class T = void>
00059 struct disable_if : public disable_if_c<Cond::value, T> {};
00060
00061 template <bool B, class T>
00062 struct lazy_disable_if_c {
00063 typedef typename T::type type;
00064 };
00065
00066 template <class T>
00067 struct lazy_disable_if_c<true, T> {};
00068
00069 template <class Cond, class T>
00070 struct lazy_disable_if : public lazy_disable_if_c<Cond::value, T> {};
00071
00072 }
00073
00074 #else
00075
00076 namespace boost {
00077
00078 namespace detail { typedef void enable_if_default_T; }
00079
00080 template <typename T>
00081 struct enable_if_does_not_work_on_this_compiler;
00082
00083 template <bool B, class T = detail::enable_if_default_T>
00084 struct enable_if_c : enable_if_does_not_work_on_this_compiler<T>
00085 { };
00086
00087 template <bool B, class T = detail::enable_if_default_T>
00088 struct disable_if_c : enable_if_does_not_work_on_this_compiler<T>
00089 { };
00090
00091 template <bool B, class T = detail::enable_if_default_T>
00092 struct lazy_enable_if_c : enable_if_does_not_work_on_this_compiler<T>
00093 { };
00094
00095 template <bool B, class T = detail::enable_if_default_T>
00096 struct lazy_disable_if_c : enable_if_does_not_work_on_this_compiler<T>
00097 { };
00098
00099 template <class Cond, class T = detail::enable_if_default_T>
00100 struct enable_if : enable_if_does_not_work_on_this_compiler<T>
00101 { };
00102
00103 template <class Cond, class T = detail::enable_if_default_T>
00104 struct disable_if : enable_if_does_not_work_on_this_compiler<T>
00105 { };
00106
00107 template <class Cond, class T = detail::enable_if_default_T>
00108 struct lazy_enable_if : enable_if_does_not_work_on_this_compiler<T>
00109 { };
00110
00111 template <class Cond, class T = detail::enable_if_default_T>
00112 struct lazy_disable_if : enable_if_does_not_work_on_this_compiler<T>
00113 { };
00114
00115 }
00116
00117 #endif // BOOST_NO_SFINAE
00118
00119 #endif