LCOV - code coverage report
Current view: top level - opt/homebrew/include/boost/variant/detail - cast_storage.hpp (source / functions) Hit Total Coverage
Test: total_coverage.info Lines: 4 4 100.0 %
Date: 2026-06-25 07:23:43 Functions: 4 10 40.0 %

          Line data    Source code
       1             : //-----------------------------------------------------------------------------
       2             : // boost variant/detail/cast_storage.hpp header file
       3             : // See http://www.boost.org for updates, documentation, and revision history.
       4             : //-----------------------------------------------------------------------------
       5             : //
       6             : // Copyright (c) 2003
       7             : // Eric Friedman
       8             : //
       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)
      12             : 
      13             : #ifndef BOOST_VARIANT_DETAIL_CAST_STORAGE_HPP
      14             : #define BOOST_VARIANT_DETAIL_CAST_STORAGE_HPP
      15             : 
      16             : #include <boost/config.hpp>
      17             : 
      18             : namespace boost {
      19             : namespace detail { namespace variant {
      20             : 
      21             : ///////////////////////////////////////////////////////////////////////////////
      22             : // (detail) function template cast_storage
      23             : //
      24             : // Casts the given storage to the specified type, but with qualification.
      25             : //
      26             : 
      27             : template <typename T>
      28      235718 : inline T& cast_storage(void* storage)
      29             : {
      30      235718 :     return *static_cast<T*>(storage);
      31             : }
      32             : 
      33             : template <typename T>
      34      321596 : inline const T& cast_storage(const void* storage)
      35             : {
      36      321596 :     return *static_cast<const T*>(storage);
      37             : }
      38             : 
      39             : }} // namespace detail::variant
      40             : } // namespace boost
      41             : 
      42             : #endif // BOOST_VARIANT_DETAIL_CAST_STORAGE_HPP

Generated by: LCOV version 1.16