21
21
22
22
namespace sigc {
23
23
24
+ #ifndef SIGCXX_DISABLE_DEPRECATED
25
+
24
26
/* * Reference wrapper.
25
27
* Use sigc::ref() to create a reference wrapper.
28
+ *
29
+ * @deprecated Use std::ref() or std::cref() instead to create a std::reference_wrapper().
26
30
*/
27
31
template <class T_type >
28
32
struct reference_wrapper
@@ -38,6 +42,8 @@ struct reference_wrapper
38
42
39
43
/* * Const reference wrapper.
40
44
* Use sigc::ref() to create a const reference wrapper.
45
+ *
46
+ * @deprecated Use std::ref() or std::cref() instead to create a std::reference_wrapper().
41
47
*/
42
48
template <class T_type >
43
49
struct const_reference_wrapper
@@ -60,6 +66,8 @@ struct const_reference_wrapper
60
66
*
61
67
* @param v Reference to store.
62
68
* @return A reference wrapper.
69
+ *
70
+ * @deprecated Use std::ref() or std::cref() instead.
63
71
*/
64
72
template <class T_type >
65
73
reference_wrapper<T_type> ref (T_type& v)
@@ -74,17 +82,27 @@ reference_wrapper<T_type> ref(T_type& v)
74
82
*
75
83
* @param v Reference to store.
76
84
* @return A reference wrapper.
85
+ *
86
+ * @deprecated Use std::ref() or std::cref() instead.
77
87
*/
78
88
template <class T_type >
79
89
const_reference_wrapper<T_type> ref (const T_type& v)
80
90
{ return const_reference_wrapper<T_type>(v); }
81
91
92
+ #endif // SIGCXX_DISABLE_DEPRECATED
93
+
94
+
82
95
template <class T_type >
83
96
struct unwrap_reference
84
97
{
85
98
typedef T_type type;
86
99
};
87
100
101
+
102
+ #ifndef SIGCXX_DISABLE_DEPRECATED
103
+
104
+ // Specializations for std::reference_wrapper and std::const_reference_wrapper:
105
+
88
106
template <class T_type >
89
107
struct unwrap_reference <reference_wrapper<T_type> >
90
108
{
@@ -105,6 +123,20 @@ template <class T_type>
105
123
const T_type& unwrap (const const_reference_wrapper<T_type>& v)
106
124
{ return v; }
107
125
126
+ #endif // SIGCXX_DISABLE_DEPRECATED
127
+
128
+ // Specializations for std::reference_wrapper:
129
+
130
+ template <class T_type >
131
+ struct unwrap_reference <std::reference_wrapper<T_type> >
132
+ {
133
+ typedef T_type& type;
134
+ };
135
+
136
+ template <class T_type >
137
+ T_type& unwrap (const std::reference_wrapper<T_type>& v)
138
+ { return v; }
139
+
108
140
} /* namespace sigc */
109
141
110
142
#endif /* _SIGC_REFERENCE_WRAPPER_H_ */
0 commit comments