]> git.saurik.com Git - wxWidgets.git/commitdiff
Add wx/meta/removeref.h header defining wxRemoveRef<> helper.
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 23 Oct 2012 12:02:00 +0000 (12:02 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 23 Oct 2012 12:02:00 +0000 (12:02 +0000)
This is a very simple template allowing to remove the reference from the given
type, similar to std::remove_reference<>.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@72721 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

Makefile.in
build/bakefiles/files.bkl
build/msw/wx_base.dsp
build/msw/wx_vc7_base.vcproj
build/msw/wx_vc8_base.vcproj
build/msw/wx_vc9_base.vcproj
include/wx/meta/removeref.h [new file with mode: 0644]
wxGTK.spec
wxMotif.spec
wxX11.spec

index ce7fc8ac94bb9c93672dd630cfc099c523d1761c..b47f71ca2ea5a24bd826327f45a2344179866b76 100644 (file)
@@ -496,6 +496,7 @@ ALL_BASE_HEADERS =  \
        wx/meta/int2type.h \
        wx/meta/movable.h \
        wx/meta/pod.h \
+       wx/meta/removeref.h \
        wx/fswatcher.h \
        wx/generic/fswatcher.h \
        $(BASE_PLATFORM_HDR) \
@@ -676,6 +677,7 @@ ALL_PORTS_BASE_HEADERS =  \
        wx/meta/int2type.h \
        wx/meta/movable.h \
        wx/meta/pod.h \
+       wx/meta/removeref.h \
        wx/fswatcher.h \
        wx/generic/fswatcher.h \
        wx/unix/app.h \
index 5a3bbffc34db357294a41d9b84c7d338dbb4315c..7864c47ad862f777a84b17ec0c2388d305c3b711 100644 (file)
@@ -543,6 +543,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
     wx/meta/int2type.h
     wx/meta/movable.h
     wx/meta/pod.h
+    wx/meta/removeref.h
     wx/fswatcher.h
     wx/generic/fswatcher.h
 </set>
index 1c26b4ad90d8006ef04340ef256fd5080d62d694..9bfbf020639c63f8c6ff4ba497694d7765a99060 100644 (file)
@@ -1475,6 +1475,10 @@ SOURCE=..\..\include\wx\regex.h
 # End Source File\r
 # Begin Source File\r
 \r
+SOURCE=..\..\include\wx\meta\removeref.h
+# End Source File
+# Begin Source File
+
 SOURCE=..\..\include\wx\rtti.h\r
 # End Source File\r
 # Begin Source File\r
index 9bea660b61327470870be3dc2a7d4a48b1d64d0b..6b9cb0d6d03b2f22a5ac3e0b01ff65066fbde915 100644 (file)
                        <File\r
                                RelativePath="..\..\include\wx\regex.h">\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\include\wx\meta\removeref.h">\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\include\wx\rtti.h">\r
                        </File>\r
index bc4673176f1451534482a01e250af368099f80ef..a6faa005262f6612c16824bcb50d05bd1a18635a 100644 (file)
                                RelativePath="..\..\include\wx\regex.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\include\wx\meta\removeref.h"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\include\wx\rtti.h"\r
                                >\r
index 20d75fc9f68ab37b4421a5ed352bce4746295d58..6cee41d20da6e610ac37daad1cd153883a7c9149 100644 (file)
                                RelativePath="..\..\include\wx\regex.h"\r
                                >\r
                        </File>\r
+                       <File\r
+                               RelativePath="..\..\include\wx\meta\removeref.h"\r
+                               >\r
+                       </File>\r
                        <File\r
                                RelativePath="..\..\include\wx\rtti.h"\r
                                >\r
diff --git a/include/wx/meta/removeref.h b/include/wx/meta/removeref.h
new file mode 100644 (file)
index 0000000..5c32c33
--- /dev/null
@@ -0,0 +1,29 @@
+///////////////////////////////////////////////////////////////////////////////
+// Name:        wx/meta/removeref.h
+// Purpose:     Allows to remove a reference from a type.
+// Author:      Vadim Zeitlin
+// Created:     2012-10-21
+// RCS-ID:      $Id$
+// Copyright:   (c) 2012 Vadim Zeitlin <vadim@wxwidgets.org>
+// Licence:     wxWindows licence
+///////////////////////////////////////////////////////////////////////////////
+
+#ifndef _WX_META_REMOVEREF_H_
+#define _WX_META_REMOVEREF_H_
+
+// wxRemoveRef<> is similar to C++11 std::remove_reference<> but works with any
+// compilers (but, to compensate for this, doesn't work with rvalue references).
+
+template <typename T>
+struct wxRemoveRef
+{
+    typedef T type;
+};
+
+template <typename T>
+struct wxRemoveRef<T&>
+{
+    typedef T type;
+};
+
+#endif // _WX_META_REMOVEREF_H_
index b4c4e4956f02b0dfedc369488d2b97f1406988e2..eb2a1590f62149b18f9349dca4e277d0b8f4a8de 100644 (file)
@@ -385,6 +385,7 @@ wx/meta/implicitconversion.h
 wx/meta/int2type.h
 wx/meta/movable.h
 wx/meta/pod.h
+wx/meta/removeref.h
 wx/fswatcher.h
 wx/generic/fswatcher.h
 wx/unix/app.h
index 790c396d0dac9bc745107627c954d99d6547b9ff..2ef607bbff84e3e5b8d66aad58e60cb85e10ee70 100644 (file)
@@ -250,6 +250,7 @@ wx/meta/implicitconversion.h
 wx/meta/int2type.h
 wx/meta/movable.h
 wx/meta/pod.h
+wx/meta/removeref.h
 wx/fswatcher.h
 wx/generic/fswatcher.h
 wx/unix/app.h
index 335e3eaba3e78248f7841a04ea729dde8ff68f26..012b91db5f8e6f10749c9520a23895d4351c9b78 100644 (file)
@@ -274,6 +274,7 @@ wx/meta/implicitconversion.h
 wx/meta/int2type.h
 wx/meta/movable.h
 wx/meta/pod.h
+wx/meta/removeref.h
 wx/fswatcher.h
 wx/generic/fswatcher.h
 wx/unix/app.h