|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r86124 - trunk/boost
From: joel.falcou_at_[hidden]
Date: 2013-10-01 11:02:28
Author: jfalcou
Date: 2013-10-01 11:02:28 EDT (Tue, 01 Oct 2013)
New Revision: 86124
URL: http://svn.boost.org/trac/boost/changeset/86124
Log:
Fix #9169 - Add BOOST_FORCEINLINE on boost::ref for performance issue
Text files modified:
trunk/boost/ref.hpp | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
Modified: trunk/boost/ref.hpp
==============================================================================
--- trunk/boost/ref.hpp Tue Oct 1 05:53:58 2013 (r86123)
+++ trunk/boost/ref.hpp 2013-10-01 11:02:28 EDT (Tue, 01 Oct 2013) (r86124)
@@ -30,17 +30,17 @@
{
template<class T> class reference_wrapper
-{
+{
public:
typedef T type;
- explicit reference_wrapper(T& t): t_(boost::addressof(t)) {}
+ BOOST_FORCEINLINE explicit reference_wrapper(T& t): t_(boost::addressof(t)) {}
- operator T& () const { return *t_; }
+ BOOST_FORCEINLINE operator T& () const { return *t_; }
- T& get() const { return *t_; }
+ BOOST_FORCEINLINE T& get() const { return *t_; }
- T* get_pointer() const { return t_; }
+ BOOST_FORCEINLINE T* get_pointer() const { return t_; }
private:
@@ -53,12 +53,12 @@
# define BOOST_REF_CONST const
# endif
-template<class T> inline reference_wrapper<T> BOOST_REF_CONST ref(T & t)
-{
+template<class T> BOOST_FORCEINLINE reference_wrapper<T> BOOST_REF_CONST ref(T & t)
+{
return reference_wrapper<T>(t);
}
-template<class T> inline reference_wrapper<T const> BOOST_REF_CONST cref(T const & t)
+template<class T> BOOST_FORCEINLINE reference_wrapper<T const> BOOST_REF_CONST cref(T const & t)
{
return reference_wrapper<T const>(t);
}
@@ -117,7 +117,7 @@
{
typedef char (&yes_reference_wrapper_t)[1];
typedef char (&no_reference_wrapper_t)[2];
-
+
no_reference_wrapper_t is_reference_wrapper_test(...);
template<typename T>
@@ -152,7 +152,7 @@
bool, value = (
sizeof(detail::is_reference_wrapper_test(type<T>()))
== sizeof(detail::yes_reference_wrapper_t)));
-
+
typedef ::boost::mpl::bool_<value> type;
};
@@ -165,13 +165,13 @@
# endif // BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION
-template <class T> inline typename unwrap_reference<T>::type&
+template <class T> BOOST_FORCEINLINE typename unwrap_reference<T>::type&
unwrap_ref(T& t)
{
return t;
}
-template<class T> inline T* get_pointer( reference_wrapper<T> const & r )
+template<class T> BOOST_FORCEINLINE T* get_pointer( reference_wrapper<T> const & r )
{
return r.get_pointer();
}
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk