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<8>{ typedef double type; };
00019 #line 564 "./lpsrc/flx_rtl.pak"
00020 template <> struct type_with_alignment<1>{ typedef char type; };
00021 #line 564 "./lpsrc/flx_rtl.pak"
00022 template <> struct type_with_alignment<2>{ typedef short type; };
00023 #line 564 "./lpsrc/flx_rtl.pak"
00024 template <> struct type_with_alignment<4>{ typedef void* type; };
00025 #line 564 "./lpsrc/flx_rtl.pak"
00026 template <> struct type_with_alignment<16>{ typedef long double type; };
00027 #line 564 "./lpsrc/flx_rtl.pak"
00028 template <typename T> struct alignment_of;
00029
00030 template <typename T>
00031 struct alignment_of_hack
00032 {
00033 char c;
00034 T t;
00035 alignment_of_hack();
00036 };
00037
00038 template <unsigned A, unsigned S>
00039 struct alignment_logic
00040 {
00041 FLX_STATIC_CONSTANT(std::size_t, value = A < S ? A : S);
00042 };
00043
00044 template< typename T >
00045 struct alignment_of
00046 {
00047 FLX_STATIC_CONSTANT(std::size_t, value =
00048 (alignment_logic<
00049 sizeof(alignment_of_hack<T>) - sizeof(T),
00050 sizeof(T)
00051 >::value));
00052 };
00053
00054 template<std::size_t L, std::size_t A>
00055 struct aligned_storage
00056 {
00057 union type
00058 {
00059 unsigned char data_[ L ];
00060 typename type_with_alignment<A>::type align_;
00061 };
00062 };
00063
00064 template<typename T>
00065 struct store_of
00066 {
00067 typedef typename aligned_storage<sizeof(T), alignment_of<T>::value>::type type;
00068 };
00069
00070
00071 template<typename T>
00072 T const &lvalue(T const &x)
00073 {
00074 return x;
00075 }
00076
00077
00078 template<typename T, typename U>
00079 T &reinterpret(U const &x) {
00080 return reinterpret_cast<T&>(const_cast<U&>(x));
00081 }
00082 #endif
00083