Mercurial > hg > vamp-build-and-test
annotate DEPENDENCIES/generic/include/boost/smart_ptr/detail/sp_forward.hpp @ 125:34e428693f5d vext
Vext -> Repoint
author | Chris Cannam |
---|---|
date | Thu, 14 Jun 2018 11:15:39 +0100 |
parents | c530137014c0 |
children |
rev | line source |
---|---|
Chris@16 | 1 #ifndef BOOST_SMART_PTR_DETAIL_SP_FORWARD_HPP_INCLUDED |
Chris@16 | 2 #define BOOST_SMART_PTR_DETAIL_SP_FORWARD_HPP_INCLUDED |
Chris@16 | 3 |
Chris@16 | 4 // MS compatible compilers support #pragma once |
Chris@16 | 5 |
Chris@16 | 6 #if defined(_MSC_VER) && (_MSC_VER >= 1020) |
Chris@16 | 7 # pragma once |
Chris@16 | 8 #endif |
Chris@16 | 9 |
Chris@16 | 10 // detail/sp_forward.hpp |
Chris@16 | 11 // |
Chris@16 | 12 // Copyright 2008,2012 Peter Dimov |
Chris@16 | 13 // |
Chris@16 | 14 // Distributed under the Boost Software License, Version 1.0. |
Chris@16 | 15 // See accompanying file LICENSE_1_0.txt or copy at |
Chris@16 | 16 // http://www.boost.org/LICENSE_1_0.txt |
Chris@16 | 17 |
Chris@16 | 18 #include <boost/config.hpp> |
Chris@16 | 19 |
Chris@16 | 20 namespace boost |
Chris@16 | 21 { |
Chris@16 | 22 |
Chris@16 | 23 namespace detail |
Chris@16 | 24 { |
Chris@16 | 25 |
Chris@16 | 26 #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES ) |
Chris@16 | 27 |
Chris@101 | 28 #if defined( BOOST_GCC ) && __GNUC__ * 100 + __GNUC_MINOR__ <= 404 |
Chris@101 | 29 |
Chris@101 | 30 // GCC 4.4 supports an outdated version of rvalue references and creates a copy of the forwarded object. |
Chris@101 | 31 // This results in warnings 'returning reference to temporary'. Therefore we use a special version similar to std::forward. |
Chris@101 | 32 template< class T > T&& sp_forward( T && t ) BOOST_NOEXCEPT |
Chris@101 | 33 { |
Chris@101 | 34 return t; |
Chris@101 | 35 } |
Chris@101 | 36 |
Chris@101 | 37 #else |
Chris@101 | 38 |
Chris@16 | 39 template< class T > T&& sp_forward( T & t ) BOOST_NOEXCEPT |
Chris@16 | 40 { |
Chris@16 | 41 return static_cast< T&& >( t ); |
Chris@16 | 42 } |
Chris@16 | 43 |
Chris@16 | 44 #endif |
Chris@16 | 45 |
Chris@101 | 46 #endif |
Chris@101 | 47 |
Chris@16 | 48 } // namespace detail |
Chris@16 | 49 |
Chris@16 | 50 } // namespace boost |
Chris@16 | 51 |
Chris@16 | 52 #endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_FORWARD_HPP_INCLUDED |