sp_forward.hpp 789 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. #ifndef BOOST_SMART_PTR_DETAIL_SP_FORWARD_HPP_INCLUDED
  2. #define BOOST_SMART_PTR_DETAIL_SP_FORWARD_HPP_INCLUDED
  3. // MS compatible compilers support #pragma once
  4. #if defined(_MSC_VER) && (_MSC_VER >= 1020)
  5. # pragma once
  6. #endif
  7. // detail/sp_forward.hpp
  8. //
  9. // Copyright 2008,2012 Peter Dimov
  10. //
  11. // Distributed under the Boost Software License, Version 1.0.
  12. // See accompanying file LICENSE_1_0.txt or copy at
  13. // http://www.boost.org/LICENSE_1_0.txt
  14. #include <boost/config.hpp>
  15. namespace boost
  16. {
  17. namespace detail
  18. {
  19. #if !defined( BOOST_NO_CXX11_RVALUE_REFERENCES )
  20. template< class T > T&& sp_forward( T & t ) BOOST_NOEXCEPT
  21. {
  22. return static_cast< T&& >( t );
  23. }
  24. #endif
  25. } // namespace detail
  26. } // namespace boost
  27. #endif // #ifndef BOOST_SMART_PTR_DETAIL_SP_FORWARD_HPP_INCLUDED