1 // Copyright (C) 2002 Brad King (brad.king@kitware.com)
2 // Doug Gregor (gregod@cs.rpi.edu)
5 // Permission to copy, use, sell and distribute this software is granted
6 // provided this copyright notice appears in all copies.
7 // Permission to modify the code and to distribute modified code is granted
8 // provided this copyright notice appears in all copies, and a notice
9 // that the code was modified is included with the copyright notice.
11 // This software is provided "as is" without express or implied warranty,
12 // and with no claim as to its suitability for any purpose.
14 // For more information, see http://www.boost.org
16 #ifndef BOOST_UTILITY_ADDRESSOF_HPP
17 #define BOOST_UTILITY_ADDRESSOF_HPP
21 // Do not make addressof() inline. Breaks MSVC 7. (Peter Dimov)
23 template <typename T> T* addressof(T& v)
25 return reinterpret_cast<T*>(
26 &const_cast<char&>(reinterpret_cast<const volatile char &>(v)));
31 #endif // BOOST_UTILITY_ADDRESSOF_HPP