wxWidgets/include/wx/meta/movable.h
Vadim Zeitlin f4b80e5337 Remove MSVC6 support.
Don't support this compiler any more, this allows to get rid of tons of
MSVC6-specific workarounds, in particular we can now use Bind() and natural
template functions calls in the library code.

Also remove MSVC6 project and solution files and don't generate them when
bakefile_gen is ran any more (removing the remaining occurrences of msvc6prj
from the bakefiles results in weird bake-time errors, so it's simpler to just
leave them there).

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76532 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-05-15 22:32:17 +00:00

45 lines
1.7 KiB
C++

/////////////////////////////////////////////////////////////////////////////
// Name: wx/meta/movable.h
// Purpose: Test if a type is movable using memmove() etc.
// Author: Vaclav Slavik
// Created: 2008-01-21
// Copyright: (c) 2008 Vaclav Slavik
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
#ifndef _WX_META_MOVABLE_H_
#define _WX_META_MOVABLE_H_
#include "wx/meta/pod.h"
#include "wx/string.h" // for wxIsMovable<wxString> specialization
// Helper to decide if an object of type T is "movable", i.e. if it can be
// copied to another memory location using memmove() or realloc() C functions.
// C++ only gurantees that POD types (including primitive types) are
// movable.
template<typename T>
struct wxIsMovable
{
static const bool value = wxIsPod<T>::value;
};
// Macro to add wxIsMovable<T> specialization for given type that marks it
// as movable:
#define WX_DECLARE_TYPE_MOVABLE(type) \
template<> struct wxIsMovable<type> \
{ \
wxDEFINE_TEMPLATE_BOOL_VALUE(true); \
};
// Our implementation of wxString is written in such way that it's safe to move
// it around (unless position cache is used which unfortunately breaks this).
// OTOH, we don't know anything about std::string.
// (NB: we don't put this into string.h and choose to include wx/string.h from
// here instead so that rarely-used wxIsMovable<T> code isn't included by
// everything)
#if !wxUSE_STD_STRING && !wxUSE_STRING_POS_CACHE
WX_DECLARE_TYPE_MOVABLE(wxString)
#endif
#endif // _WX_META_MOVABLE_H_