1 // Copyright (C) 2001-2003
4 // Distributed under the Boost Software License, Version 1.0. (See
5 // accompanying file LICENSE_1_0.txt or copy at
6 // http://www.boost.org/LICENSE_1_0.txt)
8 // See http://www.boost.org for most recent version including documentation.
10 #ifndef BOOST_FORCE_CAST_MJM012402_HPP
11 #define BOOST_FORCE_CAST_MJM012402_HPP
13 #include <boost/thread/detail/config.hpp>
19 // force_cast will convert anything to anything.
22 template<class Return_Type, class Argument_Type>
23 inline Return_Type &force_cast(Argument_Type &rSrc)
25 return(*reinterpret_cast<Return_Type *>(&rSrc));
28 // specialization for const
29 template<class Return_Type, class Argument_Type>
30 inline const Return_Type &force_cast(const Argument_Type &rSrc)
32 return(*reinterpret_cast<const Return_Type *>(&rSrc));
39 #endif // BOOST_FORCE_CAST_MJM012402_HPP