Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:51:43

0001 #ifndef BOOST_SMART_PTR_DETAIL_SP_FORWARD_HPP_INCLUDED
0002 #define BOOST_SMART_PTR_DETAIL_SP_FORWARD_HPP_INCLUDED
0003 
0004 // MS compatible compilers support #pragma once
0005 
0006 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
0007 # pragma once
0008 #endif
0009 
0010 //  detail/sp_forward.hpp
0011 //
0012 //  Copyright 2008,2012 Peter Dimov
0013 //
0014 //  Distributed under the Boost Software License, Version 1.0.
0015 //  See accompanying file LICENSE_1_0.txt or copy at
0016 //  http://www.boost.org/LICENSE_1_0.txt
0017 
0018 #include <boost/config.hpp>
0019 
0020 namespace boost
0021 {
0022 
0023 namespace detail
0024 {
0025 
0026 #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
0027 
0028 #if defined( BOOST_GCC ) && __GNUC__ * 100 + __GNUC_MINOR__ <= 404
0029 
0030 // GCC 4.4 supports an outdated version of rvalue references and creates a copy of the forwarded object.
0031 // This results in warnings 'returning reference to temporary'. Therefore we use a special version similar to std::forward.
0032 template< class T > T&& sp_forward( T && t ) BOOST_NOEXCEPT
0033 {
0034     return t;
0035 }
0036 
0037 #else
0038 
0039 template< class T > T&& sp_forward( T & t ) BOOST_NOEXCEPT
0040 {
0041     return static_cast< T&& >( t );
0042 }
0043 
0044 #endif
0045 
0046 #endif
0047 
0048 } // namespace detail
0049 
0050 } // namespace boost
0051 
0052 #endif  // #ifndef BOOST_SMART_PTR_DETAIL_SP_FORWARD_HPP_INCLUDED