1
0
forked from boostorg/core

Added ref folding creation overloads

This commit is contained in:
K-ballo
2014-06-09 19:41:23 -03:00
parent f57ded8cc8
commit af629ffa59

View File

@@ -20,6 +20,7 @@
//
// Copyright (C) 2014 Glen Joseph Fernandes
// glenfe at live dot com
// Copyright (C) 2014 Agustin Berge
//
// Distributed under the Boost Software License, Version 1.0. (See
// accompanying file LICENSE_1_0.txt or copy at
@@ -112,6 +113,15 @@ template<class T> BOOST_FORCEINLINE reference_wrapper<T> BOOST_REF_CONST ref( T
return reference_wrapper<T>(t);
}
/**
@return `ref(t.get())`
@remark Does not throw.
*/
template<class T> BOOST_FORCEINLINE reference_wrapper<T> BOOST_REF_CONST ref( reference_wrapper<T> t )
{
return reference_wrapper<T>(t.get());
}
// cref
/**
@@ -123,6 +133,15 @@ template<class T> BOOST_FORCEINLINE reference_wrapper<T const> BOOST_REF_CONST c
return reference_wrapper<T const>(t);
}
/**
@return `cref(t.get())`
@remark Does not throw.
*/
template<class T> BOOST_FORCEINLINE reference_wrapper<T const> BOOST_REF_CONST cref( reference_wrapper<T> t )
{
return reference_wrapper<T const>(t.get());
}
# undef BOOST_REF_CONST
// is_reference_wrapper