From 00560e8e178599fc37fcc6bb3c4821728d312ea6 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Wed, 10 Apr 2002 14:47:32 +0000 Subject: [PATCH] addressof.hpp: - Peter Dimov suggested a fix to deal with those evil cv-qualifiers [SVN r13431] --- include/boost/utility/addressof.hpp | 27 +-------------------------- 1 file changed, 1 insertion(+), 26 deletions(-) diff --git a/include/boost/utility/addressof.hpp b/include/boost/utility/addressof.hpp index 11a9fd3..22da536 100644 --- a/include/boost/utility/addressof.hpp +++ b/include/boost/utility/addressof.hpp @@ -17,36 +17,11 @@ namespace boost { -namespace detail { - struct addressof_helper {}; -} - template inline T* addressof(T& v) { return reinterpret_cast( - &reinterpret_cast(v)); -} - -template -inline const T* addressof(const T& v) -{ - return reinterpret_cast( - &reinterpret_cast(v)); -} - -template -inline volatile T* addressof(volatile T& v) -{ - return reinterpret_cast( - &reinterpret_cast(v)); -} - -template -inline const volatile T* addressof(const volatile T& v) -{ - return reinterpret_cast( - &reinterpret_cast(v)); + &const_cast(reinterpret_cast(v))); } }