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:
Vadim Zeitlin
2012-10-23 12:02:00 +00:00
parent 1e30d94eff
commit 32753ae949
10 changed files with 50 additions and 0 deletions

View 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_