Chris@16: // Copyright (C) 2001-2003 Chris@16: // Mac Murrett Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. (See Chris@16: // accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: // Chris@16: // See http://www.boost.org for most recent version including documentation. Chris@16: Chris@16: #ifndef BOOST_FORCE_CAST_MJM012402_HPP Chris@16: #define BOOST_FORCE_CAST_MJM012402_HPP Chris@16: Chris@16: #include Chris@16: Chris@16: namespace boost { Chris@16: namespace detail { Chris@16: namespace thread { Chris@16: Chris@16: // force_cast will convert anything to anything. Chris@16: Chris@16: // general case Chris@16: template Chris@16: inline Return_Type &force_cast(Argument_Type &rSrc) Chris@16: { Chris@16: return(*reinterpret_cast(&rSrc)); Chris@16: } Chris@16: Chris@16: // specialization for const Chris@16: template Chris@16: inline const Return_Type &force_cast(const Argument_Type &rSrc) Chris@16: { Chris@16: return(*reinterpret_cast(&rSrc)); Chris@16: } Chris@16: Chris@16: } // namespace thread Chris@16: } // namespace detail Chris@16: } // namespace boost Chris@16: Chris@16: #endif // BOOST_FORCE_CAST_MJM012402_HPP