00001 #line 546 "./lpsrc/flx_rtl.pak"
00002 #ifndef FLX_META
00003 #define FLX_META
00004
00005 #line 551 "./lpsrc/flx_rtl.pak"
00006 #define FLX_HAVE_INCLASS_MEMBER_INITIALIZATION
00007 #line 551 "./lpsrc/flx_rtl.pak"
00008 #ifdef FLX_HAVE_INCLASS_MEMBER_INITIALIZATION
00009 # define FLX_STATIC_CONSTANT(type, assignment) static const type assignment
00010 #else
00011 # define FLX_STATIC_CONSTANT(type, assignment) enum { assignment }
00012 #endif
00013
00014 #include <cstddef>
00015
00016 template <std::size_t> struct type_with_alignment;
00017 #line 564 "./lpsrc/flx_rtl.pak"
00018 template <> struct type_with_alignment<1>{ typedef char type; };
00019 #line 564 "./lpsrc/flx_rtl.pak"
00020 template <> struct type_with_alignment<2>{ typedef short type; };
00021 #line 564 "./lpsrc/flx_rtl.pak"
00022 template <> struct type_with_alignment<4>{ typedef void* type; };
00023 #line 564 "./lpsrc/flx_rtl.pak"
00024 template <typename T> struct alignment_of;
00025
00026 template <typename T>
00027 struct alignment_of_hack
00028 {
00029 char c;
00030 T t;
00031 alignment_of_hack();
00032 };
00033
00034 template <unsigned A, unsigned S>
00035 struct alignment_logic
00036 {
00037 FLX_STATIC_CONSTANT(std::size_t, value = A < S ? A : S);
00038 };
00039
00040 template< typename T >
00041 struct alignment_of
00042 {
00043 FLX_STATIC_CONSTANT(std::size_t, value =
00044 (alignment_logic<
00045 sizeof(alignment_of_hack<T>) - sizeof(T),
00046 sizeof(T)
00047 >::value));
00048 };
00049
00050 template<std::size_t L, std::size_t A>
00051 struct aligned_storage
00052 {
00053 union type
00054 {
00055 unsigned char data_[ L ];
00056 typename type_with_alignment<A>::type align_;
00057 };
00058 };
00059
00060 template<typename T>
00061 struct store_of
00062 {
00063 typedef typename aligned_storage<sizeof(T), alignment_of<T>::value>::type type;
00064 };
00065
00066
00067 template<typename T>
00068 T const &lvalue(T const &x)
00069 {
00070 return x;
00071 }
00072
00073
00074 template<typename T, typename U>
00075 T &reinterpret(U const &x) {
00076 return reinterpret_cast<T&>(const_cast<U&>(x));
00077 }
00078 #endif
00079