mirror of
https://github.com/boostorg/utility.git
synced 2025-05-09 15:04:00 +00:00
Tabs converted to spaces.
[SVN r10916]
This commit is contained in:
parent
6e5f52e279
commit
6a97f3f9ba
@ -6,18 +6,18 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
//
|
//
|
||||||
// ref.hpp - ref/cref, useful helper functions
|
// ref.hpp - ref/cref, useful helper functions
|
||||||
//
|
//
|
||||||
// Version 1.00.0003 (2001-08-22)
|
// Version 1.00.0003 (2001-08-22)
|
||||||
//
|
//
|
||||||
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
// Copyright (C) 1999, 2000 Jaakko Järvi (jaakko.jarvi@cs.utu.fi)
|
||||||
//
|
//
|
||||||
// Permission to copy, use, modify, sell and distribute this software
|
// Permission to copy, use, modify, sell and distribute this software
|
||||||
// is granted provided this copyright notice appears in all copies.
|
// is granted provided this copyright notice appears in all copies.
|
||||||
// This software is provided "as is" without express or implied
|
// This software is provided "as is" without express or implied
|
||||||
// warranty, and with no claim as to its suitability for any purpose.
|
// warranty, and with no claim as to its suitability for any purpose.
|
||||||
//
|
//
|
||||||
// See http://www.boost.org/libs/bind/ref.html for documentation.
|
// See http://www.boost.org/libs/bind/ref.html for documentation.
|
||||||
//
|
//
|
||||||
|
|
||||||
namespace boost
|
namespace boost
|
||||||
@ -27,27 +27,27 @@ template<class T> class reference_wrapper
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
explicit reference_wrapper(T & t): t_(t) {}
|
explicit reference_wrapper(T & t): t_(t) {}
|
||||||
|
|
||||||
operator T & () const { return t_; }
|
operator T & () const { return t_; }
|
||||||
|
|
||||||
T & get() const { return t_; }
|
T & get() const { return t_; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
T & t_;
|
T & t_;
|
||||||
|
|
||||||
reference_wrapper & operator= (reference_wrapper const &);
|
reference_wrapper & operator= (reference_wrapper const &);
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class T> inline reference_wrapper<T> ref(T & t)
|
template<class T> inline reference_wrapper<T> ref(T & t)
|
||||||
{
|
{
|
||||||
return reference_wrapper<T>(t);
|
return reference_wrapper<T>(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
template<class T> inline reference_wrapper<T const> cref(T const & t)
|
template<class T> inline reference_wrapper<T const> cref(T const & t)
|
||||||
{
|
{
|
||||||
return reference_wrapper<T const>(t);
|
return reference_wrapper<T const>(t);
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace boost
|
} // namespace boost
|
||||||
|
Loading…
x
Reference in New Issue
Block a user