File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
include/boost/move/detail Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -208,8 +208,26 @@ struct identity
208208{
209209 typedef T type;
210210 typedef typename add_const_lvalue_reference<T>::type reference;
211+
211212 BOOST_MOVE_FORCEINLINE reference operator ()(reference t) const
212213 { return t; }
214+
215+ // For transparent types
216+ template <class K >
217+ BOOST_MOVE_FORCEINLINE const K & operator ()(const K &t) const
218+ { return t; }
219+ };
220+
221+ // ////////////////////////////////////
222+ // identity
223+ // ////////////////////////////////////
224+ template <>
225+ struct identity <void >
226+ {
227+ template <class U >
228+ BOOST_MOVE_FORCEINLINE typename add_const_lvalue_reference<U>::type
229+ operator ()(typename add_const_lvalue_reference<U>::type t) const
230+ { return t; }
213231};
214232
215233// ////////////////////////////////////
You can’t perform that action at this time.
0 commit comments