sigx++  2.0.1
ref.h
Go to the documentation of this file.
1 #ifndef _SIGX_AUTO_REF_H_
2 #define _SIGX_AUTO_REF_H_
3 
4 /*
5  * Copyright 2008 Klaus Triendl
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Library General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Library General Public License for more details.
16  *
17  * You should have received a copy of the GNU Library General Public
18  * License along with this library; if not, write to the Free
19  * Software Foundation, 51 Franklin Street, Fifth Floor,
20  * Boston, MA 02110-1301, USA.
21  */
22 
30 #include <sigc++/reference_wrapper.h>
31 
32 
33 namespace sigx
34 {
35 
36 
37 template <class T_type>
38 sigc::reference_wrapper<T_type> ref(T_type& v)
39 {
40  return sigc::reference_wrapper<T_type>(v);
41 }
42 
43 template <class T_type>
44 sigc::const_reference_wrapper<T_type> ref(const T_type& v)
45 {
46  return sigc::const_reference_wrapper<T_type>(v);
47 }
48 
49 
50 template <class T_type>
51 sigc::reference_wrapper<T_type> ref(const sigc::reference_wrapper<T_type>& v)
52 {
53  return sigc::reference_wrapper<T_type>(v);
54 }
55 
56 template <class T_type>
57 sigc::const_reference_wrapper<T_type> ref(const sigc::const_reference_wrapper<T_type>& v)
58 {
59  return sigc::const_reference_wrapper<T_type>(v);
60 }
61 
62 
63 } // namespace sigx
64 
65 
66 #endif // file guard
sigc::reference_wrapper< T_type > ref(T_type &v)
Definition: ref.h:38