1
0
forked from boostorg/core

ref.hpp: - Use addressof() instead of & operator

[SVN r13416]
This commit is contained in:
Douglas Gregor
2002-04-10 03:36:17 +00:00
committed by Peter Dimov
parent 795ae317eb
commit 10d1e3b273

View File

@@ -6,6 +6,7 @@
# endif
# include <boost/config.hpp>
# include <boost/utility/addressof.hpp>
//
// ref.hpp - ref/cref, useful helper functions
@@ -30,7 +31,7 @@ template<class T> class reference_wrapper
public:
typedef T type;
explicit reference_wrapper(T& t): t_(&t) {}
explicit reference_wrapper(T& t): t_(addressof(t)) {}
operator T& () const { return *t_; }