Add wx/meta/removeref.h header defining wxRemoveRef<> helper.
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
This commit is contained in:
@@ -496,6 +496,7 @@ ALL_BASE_HEADERS = \
|
|||||||
wx/meta/int2type.h \
|
wx/meta/int2type.h \
|
||||||
wx/meta/movable.h \
|
wx/meta/movable.h \
|
||||||
wx/meta/pod.h \
|
wx/meta/pod.h \
|
||||||
|
wx/meta/removeref.h \
|
||||||
wx/fswatcher.h \
|
wx/fswatcher.h \
|
||||||
wx/generic/fswatcher.h \
|
wx/generic/fswatcher.h \
|
||||||
$(BASE_PLATFORM_HDR) \
|
$(BASE_PLATFORM_HDR) \
|
||||||
@@ -676,6 +677,7 @@ ALL_PORTS_BASE_HEADERS = \
|
|||||||
wx/meta/int2type.h \
|
wx/meta/int2type.h \
|
||||||
wx/meta/movable.h \
|
wx/meta/movable.h \
|
||||||
wx/meta/pod.h \
|
wx/meta/pod.h \
|
||||||
|
wx/meta/removeref.h \
|
||||||
wx/fswatcher.h \
|
wx/fswatcher.h \
|
||||||
wx/generic/fswatcher.h \
|
wx/generic/fswatcher.h \
|
||||||
wx/unix/app.h \
|
wx/unix/app.h \
|
||||||
|
@@ -543,6 +543,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
|
|||||||
wx/meta/int2type.h
|
wx/meta/int2type.h
|
||||||
wx/meta/movable.h
|
wx/meta/movable.h
|
||||||
wx/meta/pod.h
|
wx/meta/pod.h
|
||||||
|
wx/meta/removeref.h
|
||||||
wx/fswatcher.h
|
wx/fswatcher.h
|
||||||
wx/generic/fswatcher.h
|
wx/generic/fswatcher.h
|
||||||
</set>
|
</set>
|
||||||
|
@@ -1475,6 +1475,10 @@ SOURCE=..\..\include\wx\regex.h
|
|||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
|
||||||
|
SOURCE=..\..\include\wx\meta\removeref.h
|
||||||
|
# End Source File
|
||||||
|
# Begin Source File
|
||||||
|
|
||||||
SOURCE=..\..\include\wx\rtti.h
|
SOURCE=..\..\include\wx\rtti.h
|
||||||
# End Source File
|
# End Source File
|
||||||
# Begin Source File
|
# Begin Source File
|
||||||
|
@@ -1530,6 +1530,9 @@
|
|||||||
<File
|
<File
|
||||||
RelativePath="..\..\include\wx\regex.h">
|
RelativePath="..\..\include\wx\regex.h">
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\include\wx\meta\removeref.h">
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\include\wx\rtti.h">
|
RelativePath="..\..\include\wx\rtti.h">
|
||||||
</File>
|
</File>
|
||||||
|
@@ -2061,6 +2061,10 @@
|
|||||||
RelativePath="..\..\include\wx\regex.h"
|
RelativePath="..\..\include\wx\regex.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\include\wx\meta\removeref.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\include\wx\rtti.h"
|
RelativePath="..\..\include\wx\rtti.h"
|
||||||
>
|
>
|
||||||
|
@@ -2057,6 +2057,10 @@
|
|||||||
RelativePath="..\..\include\wx\regex.h"
|
RelativePath="..\..\include\wx\regex.h"
|
||||||
>
|
>
|
||||||
</File>
|
</File>
|
||||||
|
<File
|
||||||
|
RelativePath="..\..\include\wx\meta\removeref.h"
|
||||||
|
>
|
||||||
|
</File>
|
||||||
<File
|
<File
|
||||||
RelativePath="..\..\include\wx\rtti.h"
|
RelativePath="..\..\include\wx\rtti.h"
|
||||||
>
|
>
|
||||||
|
29
include/wx/meta/removeref.h
Normal file
29
include/wx/meta/removeref.h
Normal file
@@ -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_
|
@@ -385,6 +385,7 @@ wx/meta/implicitconversion.h
|
|||||||
wx/meta/int2type.h
|
wx/meta/int2type.h
|
||||||
wx/meta/movable.h
|
wx/meta/movable.h
|
||||||
wx/meta/pod.h
|
wx/meta/pod.h
|
||||||
|
wx/meta/removeref.h
|
||||||
wx/fswatcher.h
|
wx/fswatcher.h
|
||||||
wx/generic/fswatcher.h
|
wx/generic/fswatcher.h
|
||||||
wx/unix/app.h
|
wx/unix/app.h
|
||||||
|
@@ -250,6 +250,7 @@ wx/meta/implicitconversion.h
|
|||||||
wx/meta/int2type.h
|
wx/meta/int2type.h
|
||||||
wx/meta/movable.h
|
wx/meta/movable.h
|
||||||
wx/meta/pod.h
|
wx/meta/pod.h
|
||||||
|
wx/meta/removeref.h
|
||||||
wx/fswatcher.h
|
wx/fswatcher.h
|
||||||
wx/generic/fswatcher.h
|
wx/generic/fswatcher.h
|
||||||
wx/unix/app.h
|
wx/unix/app.h
|
||||||
|
@@ -274,6 +274,7 @@ wx/meta/implicitconversion.h
|
|||||||
wx/meta/int2type.h
|
wx/meta/int2type.h
|
||||||
wx/meta/movable.h
|
wx/meta/movable.h
|
||||||
wx/meta/pod.h
|
wx/meta/pod.h
|
||||||
|
wx/meta/removeref.h
|
||||||
wx/fswatcher.h
|
wx/fswatcher.h
|
||||||
wx/generic/fswatcher.h
|
wx/generic/fswatcher.h
|
||||||
wx/unix/app.h
|
wx/unix/app.h
|
||||||
|
Reference in New Issue
Block a user