00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef NTG_ENUM_BUILTIN_BOOL_HH
00029 # define NTG_ENUM_BUILTIN_BOOL_HH
00030
00031 # include <ntg/core/abstract_hierarchy.hh>
00032 # include <ntg/real/behavior.hh>
00033 # include <ntg/core/predecls.hh>
00034 # include <ntg/core/type_traits.hh>
00035
00036 namespace ntg {
00037
00038 namespace internal {
00039
00040
00041
00042
00043
00044 template <>
00045 struct typetraits<bool>
00046 {
00047 typedef bool self;
00048 typedef binary abstract_type;
00049 typedef bin ntg_type;
00050 typedef optraits<self> optraits_type;
00051 typedef unsafe::get<self> behavior_type;
00052
00053 typedef self base_type;
00054 typedef self storage_type;
00055 typedef self cumul_type;
00056 typedef self largest_type;
00057 typedef self signed_largest_type;
00058 typedef self signed_cumul_type;
00059 typedef self unsigned_largest_type;
00060 typedef self unsigned_cumul_type;
00061 typedef unsigned int integer_type;
00062 };
00063
00064
00065
00066
00067
00068 template<>
00069 struct optraits<bool>
00070 {
00071 static bool min() { return 0; }
00072 static bool max() { return 1; }
00073 static bool zero() { return 0; }
00074 static bool unit() { return 1; }
00075 static bool inf() { return min(); }
00076 static bool sup() { return max(); }
00077
00078 static unsigned max_print_width () { return 1U; }
00079
00080 static std::string name() { return "bool"; }
00081 };
00082
00083 }
00084
00085 }
00086
00087 #endif // !NTG_ENUM_BUILTIN_BOOL_HH