From af629ffa59094048c335609f285afe342fd1f1e4 Mon Sep 17 00:00:00 2001 From: K-ballo Date: Mon, 9 Jun 2014 19:41:23 -0300 Subject: [PATCH] Added ref folding creation overloads --- include/boost/core/ref.hpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/boost/core/ref.hpp b/include/boost/core/ref.hpp index 2fd4dc8..8a1acc5 100644 --- a/include/boost/core/ref.hpp +++ b/include/boost/core/ref.hpp @@ -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 BOOST_FORCEINLINE reference_wrapper BOOST_REF_CONST ref( T return reference_wrapper(t); } +/** + @return `ref(t.get())` + @remark Does not throw. +*/ +template BOOST_FORCEINLINE reference_wrapper BOOST_REF_CONST ref( reference_wrapper t ) +{ + return reference_wrapper(t.get()); +} + // cref /** @@ -123,6 +133,15 @@ template BOOST_FORCEINLINE reference_wrapper BOOST_REF_CONST c return reference_wrapper(t); } +/** + @return `cref(t.get())` + @remark Does not throw. +*/ +template BOOST_FORCEINLINE reference_wrapper BOOST_REF_CONST cref( reference_wrapper t ) +{ + return reference_wrapper(t.get()); +} + # undef BOOST_REF_CONST // is_reference_wrapper