|
||||
File indexing completed on 2025-01-18 09:53:32
0001 //----------------------------------------------------------------------------- 0002 // boost variant/detail/cast_storage.hpp header file 0003 // See http://www.boost.org for updates, documentation, and revision history. 0004 //----------------------------------------------------------------------------- 0005 // 0006 // Copyright (c) 2003 0007 // Eric Friedman 0008 // 0009 // Distributed under the Boost Software License, Version 1.0. (See 0010 // accompanying file LICENSE_1_0.txt or copy at 0011 // http://www.boost.org/LICENSE_1_0.txt) 0012 0013 #ifndef BOOST_VARIANT_DETAIL_CAST_STORAGE_HPP 0014 #define BOOST_VARIANT_DETAIL_CAST_STORAGE_HPP 0015 0016 #include <boost/config.hpp> 0017 0018 namespace boost { 0019 namespace detail { namespace variant { 0020 0021 /////////////////////////////////////////////////////////////////////////////// 0022 // (detail) function template cast_storage 0023 // 0024 // Casts the given storage to the specified type, but with qualification. 0025 // 0026 0027 template <typename T> 0028 inline T& cast_storage(void* storage) 0029 { 0030 return *static_cast<T*>(storage); 0031 } 0032 0033 template <typename T> 0034 inline const T& cast_storage(const void* storage) 0035 { 0036 return *static_cast<const T*>(storage); 0037 } 0038 0039 }} // namespace detail::variant 0040 } // namespace boost 0041 0042 #endif // BOOST_VARIANT_DETAIL_CAST_STORAGE_HPP
[ Source navigation ] | [ Diff markup ] | [ Identifier search ] | [ general search ] |
This page was automatically generated by the 2.3.7 LXR engine. The LXR team |