]> git.saurik.com Git - wxWidgets.git/blob - include/wx/meta/removeref.h
5c32c3349ec2dd2797c8773eb712e6b6ebd0f616
[wxWidgets.git] / include / wx / meta / removeref.h
1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/meta/removeref.h
3 // Purpose: Allows to remove a reference from a type.
4 // Author: Vadim Zeitlin
5 // Created: 2012-10-21
6 // RCS-ID: $Id$
7 // Copyright: (c) 2012 Vadim Zeitlin <vadim@wxwidgets.org>
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_META_REMOVEREF_H_
12 #define _WX_META_REMOVEREF_H_
13
14 // wxRemoveRef<> is similar to C++11 std::remove_reference<> but works with any
15 // compilers (but, to compensate for this, doesn't work with rvalue references).
16
17 template <typename T>
18 struct wxRemoveRef
19 {
20 typedef T type;
21 };
22
23 template <typename T>
24 struct wxRemoveRef<T&>
25 {
26 typedef T type;
27 };
28
29 #endif // _WX_META_REMOVEREF_H_