1 //-----------------------------------------------------------------------------
2 // boost variant/detail/cast_storage.hpp header file
3 // See http://www.boost.org for updates, documentation, and revision history.
4 //-----------------------------------------------------------------------------
9 // Distributed under the Boost Software License, Version 1.0. (See
10 // accompanying file LICENSE_1_0.txt or copy at
11 // http://www.boost.org/LICENSE_1_0.txt)
13 #ifndef BOOST_VARIANT_DETAIL_CAST_STORAGE_HPP
14 #define BOOST_VARIANT_DETAIL_CAST_STORAGE_HPP
16 #include "boost/config.hpp"
19 namespace detail
{ namespace variant
{
21 ///////////////////////////////////////////////////////////////////////////////
22 // (detail) function template cast_storage
24 // Casts the given storage to the specified type, but with qualification.
28 inline T
& cast_storage(
30 BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(T
)
33 return *static_cast<T
*>(storage
);
37 inline const T
& cast_storage(
39 BOOST_APPEND_EXPLICIT_TEMPLATE_TYPE(T
)
42 return *static_cast<const T
*>(storage
);
45 }} // namespace detail::variant
48 #endif // BOOST_VARIANT_DETAIL_CAST_STORAGE_HPP