mirror of
https://github.com/boostorg/utility.git
synced 2025-05-09 15:04:00 +00:00
Fix #9169 - Add BOOST_FORCEINLINE on boost::ref for performance issue
[SVN r86124]
This commit is contained in:
parent
37c8f45edc
commit
b39e4e5aea
@ -34,13 +34,13 @@ 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 @@ private:
|
||||
# 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);
|
||||
}
|
||||
@ -165,13 +165,13 @@ class unwrap_reference
|
||||
|
||||
# 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();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user