1 //////////////////////////////////////////////////////////////////////////////
3 // (C) Copyright Ion Gaztanaga 2008-2012. Distributed under the Boost
4 // Software License, Version 1.0. (See accompanying file
5 // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
7 // See http://www.boost.org/libs/container for documentation.
9 //////////////////////////////////////////////////////////////////////////////
11 #ifndef BOOST_CONTAINER_DETAIL_STORED_REF_HPP
12 #define BOOST_CONTAINER_DETAIL_STORED_REF_HPP
14 #include "config_begin.hpp"
15 #include <boost/container/detail/workaround.hpp>
17 #ifndef BOOST_NO_RVALUE_REFERENCES
21 namespace container_detail{
27 static T && forward(T &t)
28 #ifdef BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
31 { return boost::move(t); }
36 struct stored_ref<const T>
38 static const T && forward(const T &t)
39 #ifdef BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
42 { return static_cast<const T&&>(t); }
47 struct stored_ref<T&&>
49 static T && forward(T &t)
50 #ifdef BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
53 { return boost::move(t); }
58 struct stored_ref<const T&&>
60 static const T && forward(const T &t)
61 #ifdef BOOST_MOVE_OLD_RVALUE_REF_BINDING_RULES
64 { return static_cast<const T &&>(t); }
69 struct stored_ref<const T&>
71 static const T & forward(const T &t)
78 static T & forward(T &t)
82 } //namespace container_detail{
83 } //namespace container{
87 #error "This header can be included only for compiler with rvalue references"
88 #endif //BOOST_NO_RVALUE_REFERENCES
90 #include <boost/container/detail/config_end.hpp>
92 #endif //BOOST_CONTAINER_DETAIL_STORED_REF_HPP