]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/meta/movable.h
No changes, just fix a typo in a comment in docview event handling code.
[wxWidgets.git] / include / wx / meta / movable.h
index ada53540e9434db244fdc75b84f8e1c467dee586..e3a9f9e96c528b115991cd67e30ae772ed4d9e57 100644 (file)
@@ -3,7 +3,6 @@
 // Purpose:     Test if a type is movable using memmove() etc.
 // Author:      Vaclav Slavik
 // Created:     2008-01-21
-// RCS-ID:      $Id$
 // Copyright:   (c) 2008 Vaclav Slavik
 // Licence:     wxWindows licence
 /////////////////////////////////////////////////////////////////////////////
@@ -11,7 +10,7 @@
 #ifndef _WX_META_MOVABLE_H_
 #define _WX_META_MOVABLE_H_
 
-#include "wx/defs.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
@@ -21,8 +20,7 @@
 template<typename T>
 struct wxIsMovable
 {
-    // NB: enum, because VC6 can't handle "static const bool value = true;"
-    enum { value = false };
+    wxDEFINE_TEMPLATE_BOOL_VALUE(wxIsPod<T>::value);
 };
 
 // Macro to add wxIsMovable<T> specialization for given type that marks it
@@ -30,49 +28,17 @@ struct wxIsMovable
 #define WX_DECLARE_TYPE_MOVABLE(type)                       \
     template<> struct wxIsMovable<type>                     \
     {                                                       \
-        enum { value = true };                              \
+        wxDEFINE_TEMPLATE_BOOL_VALUE(true);                 \
     };
 
-WX_DECLARE_TYPE_MOVABLE(bool)
-WX_DECLARE_TYPE_MOVABLE(unsigned char)
-WX_DECLARE_TYPE_MOVABLE(signed char)
-WX_DECLARE_TYPE_MOVABLE(unsigned int)
-WX_DECLARE_TYPE_MOVABLE(signed int)
-WX_DECLARE_TYPE_MOVABLE(unsigned short int)
-WX_DECLARE_TYPE_MOVABLE(signed short int)
-WX_DECLARE_TYPE_MOVABLE(signed long int)
-WX_DECLARE_TYPE_MOVABLE(unsigned long int)
-WX_DECLARE_TYPE_MOVABLE(float)
-WX_DECLARE_TYPE_MOVABLE(double)
-WX_DECLARE_TYPE_MOVABLE(long double)
-#if wxWCHAR_T_IS_REAL_TYPE
-WX_DECLARE_TYPE_MOVABLE(wchar_t)
-#endif
-#ifdef wxLongLong_t
-WX_DECLARE_TYPE_MOVABLE(wxLongLong_t)
-WX_DECLARE_TYPE_MOVABLE(wxULongLong_t)
-#endif
-
-// pointers are movable:
-template<typename T>
-struct wxIsMovable<T*>
-{
-    enum { value = true };
-};
-template<typename T>
-struct wxIsMovable<const T*>
-{
-    enum { value = true };
-};
-
 // Our implementation of wxString is written in such way that it's safe to move
-// it around. OTOH, we don't know anything about std::string.
+// 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_STL
+#if !wxUSE_STD_STRING && !wxUSE_STRING_POS_CACHE
 WX_DECLARE_TYPE_MOVABLE(wxString)
 #endif
 
-
 #endif // _WX_META_MOVABLE_H_