MSVC fixes.

[SVN r13476]
This commit is contained in:
Peter Dimov committed 2014-06-01 01:20:11 +03:00
1 parent 077b632187
commit 84fbe634b1
2 files changed
+14 -4

No files matched your search

+9 -1
View File
@@ -12,7 +12,7 @@
// ref.hpp - ref/cref, useful helper functions
//
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
// Copyright (C) 2001 Peter Dimov
// Copyright (C) 2001, 2002 Peter Dimov
// Copyright (C) 2002 David Abrahams
//
// Permission to copy, use, modify, sell and distribute this software
@@ -31,8 +31,16 @@ template<class T> class reference_wrapper
public:
typedef T type;
#if defined(BOOST_MSVC) && (BOOST_MSVC < 1300)
explicit reference_wrapper(T& t): t_(&t) {}
#else
explicit reference_wrapper(T& t): t_(addressof(t)) {}
#endif
operator T& () const { return *t_; }
T& get() const { return *t_; }