Make local classes nonlocal to silence annoying warnings from Borland C++

[SVN r13418]
This commit is contained in:
Douglas Gregor 2002-04-10 04:00:22 +00:00
parent 0a0296a5d0
commit ec188c7c3e

View File

@ -17,35 +17,36 @@
namespace boost { namespace boost {
namespace detail {
struct addressof_helper {};
}
template <typename T> template <typename T>
inline T* addressof(T& v) inline T* addressof(T& v)
{ {
struct addressof_helper {}; return reinterpret_cast<T*>(
return reinterpret_cast<T*>(&reinterpret_cast<addressof_helper&>(v)); &reinterpret_cast<detail::addressof_helper&>(v));
} }
template <typename T> template <typename T>
inline const T* addressof(const T& v) inline const T* addressof(const T& v)
{ {
struct addressof_helper {};
return reinterpret_cast<const T*>( return reinterpret_cast<const T*>(
&reinterpret_cast<const addressof_helper&>(v)); &reinterpret_cast<const detail::addressof_helper&>(v));
} }
template <typename T> template <typename T>
inline volatile T* addressof(volatile T& v) inline volatile T* addressof(volatile T& v)
{ {
struct addressof_helper {};
return reinterpret_cast<volatile T*>( return reinterpret_cast<volatile T*>(
&reinterpret_cast<volatile addressof_helper&>(v)); &reinterpret_cast<volatile detail::addressof_helper&>(v));
} }
template <typename T> template <typename T>
inline const volatile T* addressof(const volatile T& v) inline const volatile T* addressof(const volatile T& v)
{ {
struct addressof_helper {};
return reinterpret_cast<const volatile T*>( return reinterpret_cast<const volatile T*>(
&reinterpret_cast<const volatile addressof_helper&>(v)); &reinterpret_cast<const volatile detail::addressof_helper&>(v));
} }
} }