mirror of
https://github.com/boostorg/core.git
synced 2025-05-11 13:13:55 +00:00
ref.hpp: - Use addressof() instead of & operator
[SVN r13416]
This commit is contained in:
parent
380e34f2be
commit
7c48c7ad28
@ -6,6 +6,7 @@
|
|||||||
# endif
|
# endif
|
||||||
|
|
||||||
# include <boost/config.hpp>
|
# include <boost/config.hpp>
|
||||||
|
# include <boost/utility/addressof.hpp>
|
||||||
|
|
||||||
//
|
//
|
||||||
// ref.hpp - ref/cref, useful helper functions
|
// ref.hpp - ref/cref, useful helper functions
|
||||||
@ -30,7 +31,7 @@ template<class T> class reference_wrapper
|
|||||||
public:
|
public:
|
||||||
typedef T type;
|
typedef T type;
|
||||||
|
|
||||||
explicit reference_wrapper(T& t): t_(&t) {}
|
explicit reference_wrapper(T& t): t_(addressof(t)) {}
|
||||||
|
|
||||||
operator T& () const { return *t_; }
|
operator T& () const { return *t_; }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user