Chris@16: #ifndef BOOST_SMART_PTR_DETAIL_SP_FORWARD_HPP_INCLUDED Chris@16: #define BOOST_SMART_PTR_DETAIL_SP_FORWARD_HPP_INCLUDED Chris@16: Chris@16: // MS compatible compilers support #pragma once Chris@16: Chris@16: #if defined(_MSC_VER) && (_MSC_VER >= 1020) Chris@16: # pragma once Chris@16: #endif Chris@16: Chris@16: // detail/sp_forward.hpp Chris@16: // Chris@16: // Copyright 2008,2012 Peter Dimov Chris@16: // Chris@16: // Distributed under the Boost Software License, Version 1.0. Chris@16: // See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt Chris@16: Chris@16: #include Chris@16: Chris@16: namespace boost Chris@16: { Chris@16: Chris@16: namespace detail Chris@16: { Chris@16: Chris@16: #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) Chris@16: Chris@101: #if defined( BOOST_GCC ) && __GNUC__ * 100 + __GNUC_MINOR__ <= 404 Chris@101: Chris@101: // GCC 4.4 supports an outdated version of rvalue references and creates a copy of the forwarded object. Chris@101: // This results in warnings 'returning reference to temporary'. Therefore we use a special version similar to std::forward. Chris@101: template< class T > T&& sp_forward( T && t ) BOOST_NOEXCEPT Chris@101: { Chris@101: return t; Chris@101: } Chris@101: Chris@101: #else Chris@101: Chris@16: template< class T > T&& sp_forward( T & t ) BOOST_NOEXCEPT Chris@16: { Chris@16: return static_cast< T&& >( t ); Chris@16: } Chris@16: Chris@16: #endif Chris@16: Chris@101: #endif Chris@101: Chris@16: } // namespace detail Chris@16: Chris@16: } // namespace boost Chris@16: Chris@16: #endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_FORWARD_HPP_INCLUDED