00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef BOOST_UTILITY_ADDRESSOF_HPP
00012 # define BOOST_UTILITY_ADDRESSOF_HPP
00013
00014 # include <sysc/packages/boost/config.hpp>
00015 # include <sysc/packages/boost/detail/workaround.hpp>
00016
00017 namespace boost {
00018
00019
00020
00021
00022 # if BOOST_WORKAROUND(BOOST_MSVC, == 1300)
00023
00024 template<class T> struct _addp
00025 {
00026 typedef T * type;
00027 };
00028
00029 template <typename T> typename _addp<T>::type
00030
00031 # else
00032 template <typename T> T*
00033 # endif
00034 addressof(T& v)
00035 {
00036 return reinterpret_cast<T*>(
00037 &const_cast<char&>(reinterpret_cast<const volatile char &>(v)));
00038 }
00039
00040
00041
00042 # if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x564))
00043 template<typename T,std::size_t N>
00044 T (*addressof(T (&t)[N]))[N]
00045 {
00046 return reinterpret_cast<T(*)[N]>(&t);
00047 }
00048
00049 template<typename T,std::size_t N>
00050 const T (*addressof(const T (&t)[N]))[N]
00051 {
00052 return reinterpret_cast<const T(*)[N]>(&t);
00053 }
00054 # endif
00055
00056 }
00057
00058 #endif // BOOST_UTILITY_ADDRESSOF_HPP