{ (exit 1); exit 1; }; }
done
-# There might be people who depend on the old broken behaviour: `$host'
+# There might be people who depend on the old broken behavior: `$host'
# used to hold the argument of --host etc.
# FIXME: To remove some day.
build=$build_alias
--enable-debug_cntxt obsolete, don't use: use wxDebugContext
--enable-mem_tracing obsolete, don't use: create code with memory tracing
--disable-shared create static library instead of shared
- --enable-stl use STL for containers
+ --enable-stl use standard C++ classes for everything
+ --enable-std_containers use standard C++ container classes
--enable-std_iostreams use standard C++ stream classes
--enable-std_string use standard C++ string classes
+ --enable-std_string_conv_in_wxstring provide implicit conversion to std::string in wxString
--disable-unicode compile without Unicode support
--enable-mslu use MS Layer for Unicode on Windows 9x (Win32 only)
--enable-utf8 use UTF-8 representation for strings (Unix only)
DEFAULT_wxUSE_ALL_FEATURES=yes
+DEFAULT_wxUSE_STD_CONTAINERS=$DEFAULT_STD_FLAG
DEFAULT_wxUSE_STD_IOSTREAM=$DEFAULT_STD_FLAG
DEFAULT_wxUSE_STD_STRING=$DEFAULT_STD_FLAG
echo "${ECHO_T}$result" >&6; }
+ enablestring=
+ defaultval=
+ if test -z "$defaultval"; then
+ if test x"$enablestring" = xdisable; then
+ defaultval=yes
+ else
+ defaultval=no
+ fi
+ fi
+
+ { echo "$as_me:$LINENO: checking for --${enablestring:-enable}-std_containers" >&5
+echo $ECHO_N "checking for --${enablestring:-enable}-std_containers... $ECHO_C" >&6; }
+ # Check whether --enable-std_containers was given.
+if test "${enable_std_containers+set}" = set; then
+ enableval=$enable_std_containers;
+ if test "$enableval" = yes; then
+ wx_cv_use_std_containers='wxUSE_STD_CONTAINERS=yes'
+ else
+ wx_cv_use_std_containers='wxUSE_STD_CONTAINERS=no'
+ fi
+
+else
+
+ wx_cv_use_std_containers='wxUSE_STD_CONTAINERS=${'DEFAULT_wxUSE_STD_CONTAINERS":-$defaultval}"
+
+fi
+
+
+ eval "$wx_cv_use_std_containers"
+
+ if test x"$enablestring" = xdisable; then
+ if test $wxUSE_STD_CONTAINERS = no; then
+ result=yes
+ else
+ result=no
+ fi
+ else
+ result=$wxUSE_STD_CONTAINERS
+ fi
+
+ { echo "$as_me:$LINENO: result: $result" >&5
+echo "${ECHO_T}$result" >&6; }
+
+
enablestring=
defaultval=
if test -z "$defaultval"; then
echo "${ECHO_T}$result" >&6; }
+ enablestring=
+ defaultval=
+ if test -z "$defaultval"; then
+ if test x"$enablestring" = xdisable; then
+ defaultval=yes
+ else
+ defaultval=no
+ fi
+ fi
+
+ { echo "$as_me:$LINENO: checking for --${enablestring:-enable}-std_string_conv_in_wxstring" >&5
+echo $ECHO_N "checking for --${enablestring:-enable}-std_string_conv_in_wxstring... $ECHO_C" >&6; }
+ # Check whether --enable-std_string_conv_in_wxstring was given.
+if test "${enable_std_string_conv_in_wxstring+set}" = set; then
+ enableval=$enable_std_string_conv_in_wxstring;
+ if test "$enableval" = yes; then
+ wx_cv_use_std_string_conv_in_wxstring='wxUSE_STD_STRING_CONV_IN_WXSTRING=yes'
+ else
+ wx_cv_use_std_string_conv_in_wxstring='wxUSE_STD_STRING_CONV_IN_WXSTRING=no'
+ fi
+
+else
+
+ wx_cv_use_std_string_conv_in_wxstring='wxUSE_STD_STRING_CONV_IN_WXSTRING=${'DEFAULT_wxUSE_STD_STRING_CONV_IN_WXSTRING":-$defaultval}"
+
+fi
+
+
+ eval "$wx_cv_use_std_string_conv_in_wxstring"
+
+ if test x"$enablestring" = xdisable; then
+ if test $wxUSE_STD_STRING_CONV_IN_WXSTRING = no; then
+ result=yes
+ else
+ result=no
+ fi
+ else
+ result=$wxUSE_STD_STRING_CONV_IN_WXSTRING
+ fi
+
+ { echo "$as_me:$LINENO: result: $result" >&5
+echo "${ECHO_T}$result" >&6; }
+
+
enablestring=disable
defaultval=
if test -z "$defaultval"; then
fi
+if test "$wxUSE_STD_CONTAINERS" = "yes"; then
+ cat >>confdefs.h <<\_ACEOF
+#define wxUSE_STD_CONTAINERS 1
+_ACEOF
+
+fi
+
if test "$wxUSE_STD_IOSTREAM" = "yes"; then
cat >>confdefs.h <<\_ACEOF
#define wxUSE_STD_IOSTREAM 1
fi
+if test "$wxUSE_STD_STRING_CONV_IN_WXSTRING" = "yes"; then
+ cat >>confdefs.h <<\_ACEOF
+#define wxUSE_STD_STRING_CONV_IN_WXSTRING 1
+_ACEOF
+
+fi
+
if test "$wxUSE_STDPATHS" = "yes"; then
cat >>confdefs.h <<\_ACEOF
#define wxUSE_STDPATHS 1
dnl default)
DEFAULT_wxUSE_ALL_FEATURES=yes
+DEFAULT_wxUSE_STD_CONTAINERS=$DEFAULT_STD_FLAG
DEFAULT_wxUSE_STD_IOSTREAM=$DEFAULT_STD_FLAG
DEFAULT_wxUSE_STD_STRING=$DEFAULT_STD_FLAG
dnl ---------------------------------------------------------------------------
WX_ARG_DISABLE(shared, [ --disable-shared create static library instead of shared], wxUSE_SHARED)
-WX_ARG_ENABLE(stl, [ --enable-stl use STL for containers], wxUSE_STL)
+WX_ARG_ENABLE(stl, [ --enable-stl use standard C++ classes for everything], wxUSE_STL)
+WX_ARG_ENABLE(std_containers,[ --enable-std_containers use standard C++ container classes], wxUSE_STD_CONTAINERS)
WX_ARG_ENABLE(std_iostreams, [ --enable-std_iostreams use standard C++ stream classes], wxUSE_STD_IOSTREAM)
WX_ARG_ENABLE(std_string, [ --enable-std_string use standard C++ string classes], wxUSE_STD_STRING)
+WX_ARG_ENABLE(std_string_conv_in_wxstring, [ --enable-std_string_conv_in_wxstring provide implicit conversion to std::string in wxString], wxUSE_STD_STRING_CONV_IN_WXSTRING)
WX_ARG_DISABLE(unicode, [ --disable-unicode compile without Unicode support], wxUSE_UNICODE)
WX_ARG_ENABLE(mslu, [ --enable-mslu use MS Layer for Unicode on Windows 9x (Win32 only)], wxUSE_UNICODE_MSLU)
WX_ARG_ENABLE_PARAM(utf8, [ --enable-utf8 use UTF-8 representation for strings (Unix only)], wxUSE_UNICODE_UTF8)
AC_DEFINE(wxUSE_BUSYINFO)
fi
+if test "$wxUSE_STD_CONTAINERS" = "yes"; then
+ AC_DEFINE(wxUSE_STD_CONTAINERS)
+fi
+
if test "$wxUSE_STD_IOSTREAM" = "yes"; then
AC_DEFINE(wxUSE_STD_IOSTREAM)
fi
AC_DEFINE(wxUSE_STD_STRING)
fi
+if test "$wxUSE_STD_STRING_CONV_IN_WXSTRING" = "yes"; then
+ AC_DEFINE(wxUSE_STD_STRING_CONV_IN_WXSTRING)
+fi
+
if test "$wxUSE_STDPATHS" = "yes"; then
AC_DEFINE(wxUSE_STDPATHS)
fi
All:
+- Use standard implementations of container classes by default, you need to
+ explicitly set wxUSE_STD_CONTAINERS to 0 to use wxWidgets implementations.
- Added cwd and env arguments to wxExecute() (Emilien Kia).
- Added "rest" argument to wxString::Before{First,Last}().
- Added wxThread::OnKill() and OnDelete() callbacks.
return wxStringSortAscending(s2, s1);
}
-#if wxUSE_STL
+#if wxUSE_STD_CONTAINERS
#include "wx/dynarray.h"
}
};
-#else // if !wxUSE_STL
+#else // if !wxUSE_STD_CONTAINERS
// this shouldn't be defined for compilers not supporting template methods or
// without std::distance()
{ Copy(array); }
};
-#endif // !wxUSE_STL
+#endif // !wxUSE_STD_CONTAINERS
// this class provides a temporary wxString* from a
// wxArrayString
#endif
// deriving wxWin containers from STL ones changes them completely:
-#if wxUSE_STL
+#if wxUSE_STD_CONTAINERS
#define __WX_BO_STL ",STL containers"
#else
#define __WX_BO_STL ",wx containers"
# endif
#endif /* !defined(wxUSE_SOCKETS) */
+#ifndef wxUSE_STD_CONTAINERS
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_STD_CONTAINERS must be defined, please read comment near the top of this file."
+# else
+# define wxUSE_STD_CONTAINERS 0
+# endif
+#endif /* !defined(wxUSE_STD_CONTAINERS) */
+
+#ifndef wxUSE_STD_STRING_CONV_IN_WXSTRING
+# ifdef wxABORT_ON_CONFIG_ERROR
+# error "wxUSE_STD_STRING_CONV_IN_WXSTRING must be defined, please read comment near the top of this file."
+# else
+# define wxUSE_STD_STRING_CONV_IN_WXSTRING 0
+# endif
+#endif /* !defined(wxUSE_STD_STRING_CONV_IN_WXSTRING) */
+
#ifndef wxUSE_STREAMS
# ifdef wxABORT_ON_CONFIG_ERROR
# error "wxUSE_STREAMS must be defined, please read comment near the top of this file."
class 'bar'" */
# pragma warning(disable:4251)
+ /*
+ This is a similar warning which occurs when deriving from standard
+ containers. MSDN even mentions that it can be ignored in this case
+ (albeit only in debug build while the warning is the same in release
+ too and seems equally harmless).
+ */
+#if wxUSE_STD_CONTAINERS
+# pragma warning(disable:4275)
+#endif /// wxUSE_STD_CONTAINERS
+
# ifdef __VISUALC5__
/* For VC++ 5.0 for release mode, the warning 'C4702: unreachable code */
/* is buggy, and occurs for code that does actually get executed */
#endif
#if defined(__CYGWIN__) && defined(__WXMSW__)
-# if wxUSE_STL || defined(wxUSE_STD_STRING)
+# if wxUSE_STD_CONTAINERS || defined(wxUSE_STD_STRING)
/*
NASTY HACK because the gethostname in sys/unistd.h which the gnu
stl includes and wx builds with by default clash with each other
#include "wx/defs.h"
#include "wx/utils.h"
-#if wxUSE_STL
+#if wxUSE_STD_CONTAINERS
#include "wx/beforestd.h"
#include <algorithm>
}
};
-#else // STL
+#else // !wxUSE_STD_CONTAINERS
template <typename T>
class wxDList
} */
};
-#endif // wxUSE_STL/!wxUSE_STL
+#endif // wxUSE_STD_CONTAINERS/!wxUSE_STD_CONTAINERS
#endif // _WX_DLIST_H_
#include "wx/defs.h"
-#if wxUSE_STL
+#if wxUSE_STD_CONTAINERS
#include "wx/beforestd.h"
#include <vector>
#include <algorithm>
// you cast "SomeArray *" as "BaseArray *" and then delete it)
// ----------------------------------------------------------------------------
-#if wxUSE_STL
+#if wxUSE_STD_CONTAINERS
template<class T>
class wxArray_SortFunction
} \
}
-#else // if !wxUSE_STL
+#else // if !wxUSE_STD_CONTAINERS
#define _WX_DECLARE_BASEARRAY(T, name, classexp) \
classexp name \
{ \
- typedef CMPFUNC SCMPFUNC; /* for compatibility wuth wxUSE_STL */ \
+ typedef CMPFUNC SCMPFUNC; /* for compatibility wuth wxUSE_STD_CONTAINERS */ \
public: \
name(); \
name(const name& array); \
T *m_pItems; \
}
-#endif // !wxUSE_STL
+#endif // !wxUSE_STD_CONTAINERS
// ============================================================================
// The private helper macros containing the core of the array classes
// _WX_DEFINE_TYPEARRAY: array for simple types
// ----------------------------------------------------------------------------
-#if wxUSE_STL
+#if wxUSE_STD_CONTAINERS
// in STL case we don't need the entire base arrays hack as standard container
// don't suffer from alignment/storage problems as our home-grown do
#define _WX_DEFINE_TYPEARRAY_PTR(T, name, base, classexp) \
_WX_DEFINE_TYPEARRAY(T, name, base, classexp)
-#else // if !wxUSE_STL
+#else // if !wxUSE_STD_CONTAINERS
// common declaration used by both _WX_DEFINE_TYPEARRAY and
// _WX_DEFINE_TYPEARRAY_PTR
#define _WX_DEFINE_TYPEARRAY_PTR(T, name, base, classexp) \
_WX_DEFINE_TYPEARRAY_HELPER(T, name, base, classexp, _WX_PTROP_NONE)
-#endif // !wxUSE_STL
+#endif // !wxUSE_STD_CONTAINERS
// ----------------------------------------------------------------------------
// _WX_DEFINE_SORTED_TYPEARRAY: sorted array for simple data types
{
public:
wxResourceCache() { }
-#if !wxUSE_STL
+#if !wxUSE_STD_CONTAINERS
wxResourceCache(const unsigned int keyType) : wxList(keyType) { }
#endif
virtual ~wxResourceCache();
#include "wx/defs.h"
#include "wx/string.h"
-#if !wxUSE_STL
+#if !wxUSE_STD_CONTAINERS
#include "wx/object.h"
#else
class WXDLLIMPEXP_FWD_BASE wxObject;
};
class WXDLLIMPEXP_BASE wxHashTableBase
-#if !wxUSE_STL
+#if !wxUSE_STD_CONTAINERS
: public wxObject
#endif
{
#include "wx/string.h"
#include "wx/wxcrt.h"
-// In wxUSE_STL build we prefer to use the standard hash map class but it can
-// be either in non-standard hash_map header (old g++ and some other STL
-// implementations) or in C++0x standard unordered_map which can in turn be
+// In wxUSE_STD_CONTAINERS build we prefer to use the standard hash map class
+// but it can be either in non-standard hash_map header (old g++ and some other
+// STL implementations) or in C++0x standard unordered_map which can in turn be
// available either in std::tr1 or std namespace itself
//
// To summarize: if std::unordered_map is available use it, otherwise use tr1
#define HAVE_STL_HASH_MAP
#endif
-#if wxUSE_STL && \
+#if wxUSE_STD_CONTAINERS && \
(defined(HAVE_STD_UNORDERED_MAP) || defined(HAVE_TR1_UNORDERED_MAP))
#if defined(HAVE_STD_UNORDERED_MAP)
#define _WX_DECLARE_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, CLASSEXP ) \
typedef WX_HASH_MAP_NAMESPACE::unordered_map< KEY_T, VALUE_T, HASH_T, KEY_EQ_T > CLASSNAME
-#elif wxUSE_STL && defined(HAVE_STL_HASH_MAP)
+#elif wxUSE_STD_CONTAINERS && defined(HAVE_STL_HASH_MAP)
#if defined(HAVE_EXT_HASH_MAP)
#include <ext/hash_map>
#define _WX_DECLARE_HASH_MAP( KEY_T, VALUE_T, HASH_T, KEY_EQ_T, CLASSNAME, CLASSEXP ) \
typedef WX_HASH_MAP_NAMESPACE::hash_map< KEY_T, VALUE_T, HASH_T, KEY_EQ_T > CLASSNAME
-#else // !wxUSE_STL || no std::{hash,unordered}_map class available
+#else // !wxUSE_STD_CONTAINERS || no std::{hash,unordered}_map class available
#define wxNEEDS_WX_HASH_MAP
// see comment in wx/hashmap.h which also applies to different standard hash
// set classes
-#if wxUSE_STL && \
+#if wxUSE_STD_CONTAINERS && \
(defined(HAVE_STD_UNORDERED_SET) || defined(HAVE_TR1_UNORDERED_SET))
#if defined(HAVE_STD_UNORDERED_SET)
#error Update this code: unordered_set is available, but I do not know where.
#endif
-#elif wxUSE_STL && defined(HAVE_STL_HASH_MAP)
+#elif wxUSE_STD_CONTAINERS && defined(HAVE_STL_HASH_MAP)
#if defined(HAVE_EXT_HASH_MAP)
#include <ext/hash_set>
#include "wx/object.h"
#include "wx/string.h"
-#if wxUSE_STL
+#if wxUSE_STD_CONTAINERS
#include "wx/beforestd.h"
#include <algorithm>
#include <iterator>
class WXDLLIMPEXP_FWD_BASE wxObjectListNode;
typedef wxObjectListNode wxNode;
-#if wxUSE_STL
+#if wxUSE_STD_CONTAINERS
#define wxLIST_COMPATIBILITY
#define WX_DEFINE_EXPORTED_LIST(name) WX_DEFINE_LIST(name)
#define WX_DEFINE_USER_EXPORTED_LIST(name) WX_DEFINE_LIST(name)
-#else // if !wxUSE_STL
+#else // if !wxUSE_STD_CONTAINERS
// undef it to get rid of old, deprecated functions
#define WX_DEFINE_EXPORTED_LIST(name) WX_DEFINE_LIST(name)
#define WX_DEFINE_USER_EXPORTED_LIST(name) WX_DEFINE_LIST(name)
-#endif // !wxUSE_STL
+#endif // !wxUSE_STD_CONTAINERS
// ============================================================================
// now we can define classes 100% compatible with the old ones
// inline compatibility functions
-#if !wxUSE_STL
+#if !wxUSE_STD_CONTAINERS
// ----------------------------------------------------------------------------
// wxNodeBase deprecated methods
class WXDLLIMPEXP_BASE wxList : public wxObjectList
{
public:
-#if defined(wxWARN_COMPAT_LIST_USE) && !wxUSE_STL
+#if defined(wxWARN_COMPAT_LIST_USE) && !wxUSE_STD_CONTAINERS
wxList() { };
wxDEPRECATED( wxList(int key_type) );
-#elif !wxUSE_STL
+#elif !wxUSE_STD_CONTAINERS
wxList(int key_type = wxKEY_NONE);
#endif
// this destructor is required for Darwin
~wxList() { }
-#if !wxUSE_STL
+#if !wxUSE_STD_CONTAINERS
wxList& operator=(const wxList& list)
{ if (&list != this) Assign(list); return *this; }
// compatibility methods
void Sort(wxSortCompareFunction compfunc) { wxListBase::Sort(compfunc); }
-#endif // !wxUSE_STL
+#endif // !wxUSE_STD_CONTAINERS
};
-#if !wxUSE_STL
+#if !wxUSE_STD_CONTAINERS
// -----------------------------------------------------------------------------
// wxStringList class for compatibility with the old code
void DoCopy(const wxStringList&); // common part of copy ctor and operator=
};
-#else // if wxUSE_STL
+#else // if wxUSE_STD_CONTAINERS
WX_DECLARE_LIST_XO(wxString, wxStringListBase, class WXDLLIMPEXP_BASE);
{ push_front(s); return GetFirst(); }
};
-#endif // wxUSE_STL
+#endif // wxUSE_STD_CONTAINERS
#endif // wxLIST_COMPATIBILITY
// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#if wxUSE_STL
+#if wxUSE_STD_CONTAINERS
#undef WX_DEFINE_LIST
#define WX_DEFINE_LIST(name) \
} \
name::BaseListType name::EmptyList;
-#else // !wxUSE_STL
+#else // !wxUSE_STD_CONTAINERS
#undef WX_DEFINE_LIST_2
#define WX_DEFINE_LIST_2(T, name) \
void wx##name##Node::DeleteData() \
#undef WX_DEFINE_LIST
#define WX_DEFINE_LIST(name) WX_DEFINE_LIST_2(_WX_LIST_ITEM_TYPE_##name, name)
-#endif // wxUSE_STL/!wxUSE_STL
+#endif // wxUSE_STD_CONTAINERS/!wxUSE_STD_CONTAINERS
// (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 && !wxUSE_STRING_POS_CACHE
+#if !wxUSE_STD_STRING && !wxUSE_STRING_POS_CACHE
WX_DECLARE_TYPE_MOVABLE(wxString)
#endif
// Recommended setting: 0 (this is still work in progress...)
#define wxUSE_EXTENDED_RTTI 0
-// Set wxUSE_STL to 1 to derive wxList(Foo) and wxArray(Foo) from
-// std::list<Foo*> and std::vector<Foo*>, with a compatibility interface,
-// and for wxHashMap to be implemented with templates.
-//
-// Default is 0
-//
-// Recommended setting: YMMV
-#define wxUSE_STL 0
-
// Support for message/error logging. This includes wxLogXXX() functions and
// wxLog and derived classes. Don't set this to 0 unless you really know what
// you are doing.
// Recommended setting: 1 as setting it to 0 disables many other things
#define wxUSE_STREAMS 1
+// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf.
+// Note that if the system's implementation does not support positional
+// parameters, setting this to 1 forces the use of the wxWidgets implementation
+// of wxVsnprintf. The standard vsnprintf() supports positional parameters on
+// many Unix systems but usually doesn't under Windows.
+//
+// Positional parameters are very useful when translating a program since using
+// them in formatting strings allow translators to correctly reorder the
+// translated sentences.
+//
+// Default is 1
+//
+// Recommended setting: 1 if you want to support multiple languages
+#define wxUSE_PRINTF_POS_PARAMS 1
+
+
+// ----------------------------------------------------------------------------
+// Interoperability with the standard library.
+// ----------------------------------------------------------------------------
+
+// Set wxUSE_STL to 1 to enable maximal interoperability with the standard
+// library, even at the cost of backwards compatibility.
+//
+// Default is 0
+//
+// Recommended setting: 0 as the options below already provide a relatively
+// good level of interoperability and changing this option arguably isn't worth
+// diverging from the official builds of the library.
+#define wxUSE_STL 0
+
// This is not a real option but is used as the default value for
-// wxUSE_STD_IOSTREAM and wxUSE_STD_STRING.
+// wxUSE_STD_IOSTREAM, wxUSE_STD_STRING and wxUSE_STD_CONTAINERS.
//
// Currently the Digital Mars and Watcom compilers come without standard C++
// library headers by default, wxUSE_STD_STRING can be set to 1 if you do have
#define wxUSE_STD_DEFAULT 1
#endif
+// Use standard C++ containers to implement wxVector<>, wxStack<>, wxDList<>
+// and wxHashXXX<> classes. If disabled, wxWidgets own (mostly compatible but
+// usually more limited) implementations are used which allows to avoid the
+// dependency on the C++ run-time library.
+//
+// Default is 1 if compiler supports it.
+//
+// Recommended setting: 1 unless you use a system without good implementation
+// of STL.
+#define wxUSE_STD_CONTAINERS wxUSE_STD_DEFAULT
+
// Use standard C++ streams if 1 instead of wx streams in some places. If
-// disabled (default), wx streams are used everywhere and wxWidgets doesn't
-// depend on the standard streams library.
+// disabled, wx streams are used everywhere and wxWidgets doesn't depend on the
+// standard streams library.
//
// Notice that enabling this does not replace wx streams with std streams
// everywhere, in a lot of places wx streams are used no matter what.
//
-// Default is 0
+// Default is 1 if compiler supports it.
//
// Recommended setting: 1 if you use the standard streams anyhow and so
// dependency on the standard streams library is not a
// problem
#define wxUSE_STD_IOSTREAM wxUSE_STD_DEFAULT
-// Enable conversion to standard C++ string if 1.
+// Enable minimal interoperability with the standard C++ string class if 1.
+// "Minimal" means that wxString can be constructed from std::string or
+// std::wstring but can't be implicitly converted to them. You need to enable
+// the option below for the latter.
//
// Default is 1 for most compilers.
//
// the standard C++ library at all.
#define wxUSE_STD_STRING wxUSE_STD_DEFAULT
-// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf.
-// Note that if the system's implementation does not support positional
-// parameters, setting this to 1 forces the use of the wxWidgets implementation
-// of wxVsnprintf. The standard vsnprintf() supports positional parameters on
-// many Unix systems but usually doesn't under Windows.
+// Make wxString as much interchangeable with std::[w]string as possible, in
+// particular allow implicit conversion of wxString to either of these classes.
+// This comes at a price (or a benefit, depending on your point of view) of not
+// allowing implicit conversion to "const char *" and "const wchar_t *".
//
-// Positional parameters are very useful when translating a program since using
-// them in formatting strings allow translators to correctly reorder the
-// translated sentences.
+// Because a lot of existing code relies on these conversions, this option is
+// disabled by default but can be enabled for your build if you don't care
+// about compatibility.
//
-// Default is 1
+// Default is 0 if wxUSE_STL has its default value or 1 if it is enabled.
//
-// Recommended setting: 1 if you want to support multiple languages
-#define wxUSE_PRINTF_POS_PARAMS 1
+// Recommended setting: 0 to remain compatible with the official builds of
+// wxWidgets.
+#define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL
+
// ----------------------------------------------------------------------------
// non GUI features selection
// Recommended setting: 0 (this is still work in progress...)
#define wxUSE_EXTENDED_RTTI 0
-// Set wxUSE_STL to 1 to derive wxList(Foo) and wxArray(Foo) from
-// std::list<Foo*> and std::vector<Foo*>, with a compatibility interface,
-// and for wxHashMap to be implemented with templates.
-//
-// Default is 0
-//
-// Recommended setting: YMMV
-#define wxUSE_STL 0
-
// Support for message/error logging. This includes wxLogXXX() functions and
// wxLog and derived classes. Don't set this to 0 unless you really know what
// you are doing.
// Recommended setting: 1 as setting it to 0 disables many other things
#define wxUSE_STREAMS 1
+// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf.
+// Note that if the system's implementation does not support positional
+// parameters, setting this to 1 forces the use of the wxWidgets implementation
+// of wxVsnprintf. The standard vsnprintf() supports positional parameters on
+// many Unix systems but usually doesn't under Windows.
+//
+// Positional parameters are very useful when translating a program since using
+// them in formatting strings allow translators to correctly reorder the
+// translated sentences.
+//
+// Default is 1
+//
+// Recommended setting: 1 if you want to support multiple languages
+#define wxUSE_PRINTF_POS_PARAMS 1
+
+
+// ----------------------------------------------------------------------------
+// Interoperability with the standard library.
+// ----------------------------------------------------------------------------
+
+// Set wxUSE_STL to 1 to enable maximal interoperability with the standard
+// library, even at the cost of backwards compatibility.
+//
+// Default is 0
+//
+// Recommended setting: 0 as the options below already provide a relatively
+// good level of interoperability and changing this option arguably isn't worth
+// diverging from the official builds of the library.
+#define wxUSE_STL 0
+
// This is not a real option but is used as the default value for
-// wxUSE_STD_IOSTREAM and wxUSE_STD_STRING.
+// wxUSE_STD_IOSTREAM, wxUSE_STD_STRING and wxUSE_STD_CONTAINERS.
//
// Currently the Digital Mars and Watcom compilers come without standard C++
// library headers by default, wxUSE_STD_STRING can be set to 1 if you do have
#define wxUSE_STD_DEFAULT 1
#endif
+// Use standard C++ containers to implement wxVector<>, wxStack<>, wxDList<>
+// and wxHashXXX<> classes. If disabled, wxWidgets own (mostly compatible but
+// usually more limited) implementations are used which allows to avoid the
+// dependency on the C++ run-time library.
+//
+// Default is 1 if compiler supports it.
+//
+// Recommended setting: 1 unless you use a system without good implementation
+// of STL.
+#define wxUSE_STD_CONTAINERS wxUSE_STD_DEFAULT
+
// Use standard C++ streams if 1 instead of wx streams in some places. If
-// disabled (default), wx streams are used everywhere and wxWidgets doesn't
-// depend on the standard streams library.
+// disabled, wx streams are used everywhere and wxWidgets doesn't depend on the
+// standard streams library.
//
// Notice that enabling this does not replace wx streams with std streams
// everywhere, in a lot of places wx streams are used no matter what.
//
-// Default is 0
+// Default is 1 if compiler supports it.
//
// Recommended setting: 1 if you use the standard streams anyhow and so
// dependency on the standard streams library is not a
// problem
#define wxUSE_STD_IOSTREAM wxUSE_STD_DEFAULT
-// Enable conversion to standard C++ string if 1.
+// Enable minimal interoperability with the standard C++ string class if 1.
+// "Minimal" means that wxString can be constructed from std::string or
+// std::wstring but can't be implicitly converted to them. You need to enable
+// the option below for the latter.
//
// Default is 1 for most compilers.
//
// the standard C++ library at all.
#define wxUSE_STD_STRING wxUSE_STD_DEFAULT
-// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf.
-// Note that if the system's implementation does not support positional
-// parameters, setting this to 1 forces the use of the wxWidgets implementation
-// of wxVsnprintf. The standard vsnprintf() supports positional parameters on
-// many Unix systems but usually doesn't under Windows.
+// Make wxString as much interchangeable with std::[w]string as possible, in
+// particular allow implicit conversion of wxString to either of these classes.
+// This comes at a price (or a benefit, depending on your point of view) of not
+// allowing implicit conversion to "const char *" and "const wchar_t *".
//
-// Positional parameters are very useful when translating a program since using
-// them in formatting strings allow translators to correctly reorder the
-// translated sentences.
+// Because a lot of existing code relies on these conversions, this option is
+// disabled by default but can be enabled for your build if you don't care
+// about compatibility.
//
-// Default is 1
+// Default is 0 if wxUSE_STL has its default value or 1 if it is enabled.
//
-// Recommended setting: 1 if you want to support multiple languages
-#define wxUSE_PRINTF_POS_PARAMS 1
+// Recommended setting: 0 to remain compatible with the official builds of
+// wxWidgets.
+#define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL
+
// ----------------------------------------------------------------------------
// non GUI features selection
// Recommended setting: 0 (this is still work in progress...)
#define wxUSE_EXTENDED_RTTI 0
-// Set wxUSE_STL to 1 to derive wxList(Foo) and wxArray(Foo) from
-// std::list<Foo*> and std::vector<Foo*>, with a compatibility interface,
-// and for wxHashMap to be implemented with templates.
-//
-// Default is 0
-//
-// Recommended setting: YMMV
-#define wxUSE_STL 0
-
// Support for message/error logging. This includes wxLogXXX() functions and
// wxLog and derived classes. Don't set this to 0 unless you really know what
// you are doing.
// Recommended setting: 1 as setting it to 0 disables many other things
#define wxUSE_STREAMS 1
+// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf.
+// Note that if the system's implementation does not support positional
+// parameters, setting this to 1 forces the use of the wxWidgets implementation
+// of wxVsnprintf. The standard vsnprintf() supports positional parameters on
+// many Unix systems but usually doesn't under Windows.
+//
+// Positional parameters are very useful when translating a program since using
+// them in formatting strings allow translators to correctly reorder the
+// translated sentences.
+//
+// Default is 1
+//
+// Recommended setting: 1 if you want to support multiple languages
+#define wxUSE_PRINTF_POS_PARAMS 1
+
+
+// ----------------------------------------------------------------------------
+// Interoperability with the standard library.
+// ----------------------------------------------------------------------------
+
+// Set wxUSE_STL to 1 to enable maximal interoperability with the standard
+// library, even at the cost of backwards compatibility.
+//
+// Default is 0
+//
+// Recommended setting: 0 as the options below already provide a relatively
+// good level of interoperability and changing this option arguably isn't worth
+// diverging from the official builds of the library.
+#define wxUSE_STL 0
+
// This is not a real option but is used as the default value for
-// wxUSE_STD_IOSTREAM and wxUSE_STD_STRING.
+// wxUSE_STD_IOSTREAM, wxUSE_STD_STRING and wxUSE_STD_CONTAINERS.
//
// Currently the Digital Mars and Watcom compilers come without standard C++
// library headers by default, wxUSE_STD_STRING can be set to 1 if you do have
#define wxUSE_STD_DEFAULT 1
#endif
+// Use standard C++ containers to implement wxVector<>, wxStack<>, wxDList<>
+// and wxHashXXX<> classes. If disabled, wxWidgets own (mostly compatible but
+// usually more limited) implementations are used which allows to avoid the
+// dependency on the C++ run-time library.
+//
+// Default is 1 if compiler supports it.
+//
+// Recommended setting: 1 unless you use a system without good implementation
+// of STL.
+#define wxUSE_STD_CONTAINERS wxUSE_STD_DEFAULT
+
// Use standard C++ streams if 1 instead of wx streams in some places. If
-// disabled (default), wx streams are used everywhere and wxWidgets doesn't
-// depend on the standard streams library.
+// disabled, wx streams are used everywhere and wxWidgets doesn't depend on the
+// standard streams library.
//
// Notice that enabling this does not replace wx streams with std streams
// everywhere, in a lot of places wx streams are used no matter what.
//
-// Default is 0
+// Default is 1 if compiler supports it.
//
// Recommended setting: 1 if you use the standard streams anyhow and so
// dependency on the standard streams library is not a
// problem
#define wxUSE_STD_IOSTREAM wxUSE_STD_DEFAULT
-// Enable conversion to standard C++ string if 1.
+// Enable minimal interoperability with the standard C++ string class if 1.
+// "Minimal" means that wxString can be constructed from std::string or
+// std::wstring but can't be implicitly converted to them. You need to enable
+// the option below for the latter.
//
// Default is 1 for most compilers.
//
// the standard C++ library at all.
#define wxUSE_STD_STRING wxUSE_STD_DEFAULT
-// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf.
-// Note that if the system's implementation does not support positional
-// parameters, setting this to 1 forces the use of the wxWidgets implementation
-// of wxVsnprintf. The standard vsnprintf() supports positional parameters on
-// many Unix systems but usually doesn't under Windows.
+// Make wxString as much interchangeable with std::[w]string as possible, in
+// particular allow implicit conversion of wxString to either of these classes.
+// This comes at a price (or a benefit, depending on your point of view) of not
+// allowing implicit conversion to "const char *" and "const wchar_t *".
//
-// Positional parameters are very useful when translating a program since using
-// them in formatting strings allow translators to correctly reorder the
-// translated sentences.
+// Because a lot of existing code relies on these conversions, this option is
+// disabled by default but can be enabled for your build if you don't care
+// about compatibility.
//
-// Default is 1
+// Default is 0 if wxUSE_STL has its default value or 1 if it is enabled.
//
-// Recommended setting: 1 if you want to support multiple languages
-#define wxUSE_PRINTF_POS_PARAMS 1
+// Recommended setting: 0 to remain compatible with the official builds of
+// wxWidgets.
+#define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL
+
// ----------------------------------------------------------------------------
// non GUI features selection
// Recommended setting: 0 (this is still work in progress...)
#define wxUSE_EXTENDED_RTTI 0
-// Set wxUSE_STL to 1 to derive wxList(Foo) and wxArray(Foo) from
-// std::list<Foo*> and std::vector<Foo*>, with a compatibility interface,
-// and for wxHashMap to be implemented with templates.
-//
-// Default is 0
-//
-// Recommended setting: YMMV
-#define wxUSE_STL 0
-
// Support for message/error logging. This includes wxLogXXX() functions and
// wxLog and derived classes. Don't set this to 0 unless you really know what
// you are doing.
// Recommended setting: 1 as setting it to 0 disables many other things
#define wxUSE_STREAMS 1
+// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf.
+// Note that if the system's implementation does not support positional
+// parameters, setting this to 1 forces the use of the wxWidgets implementation
+// of wxVsnprintf. The standard vsnprintf() supports positional parameters on
+// many Unix systems but usually doesn't under Windows.
+//
+// Positional parameters are very useful when translating a program since using
+// them in formatting strings allow translators to correctly reorder the
+// translated sentences.
+//
+// Default is 1
+//
+// Recommended setting: 1 if you want to support multiple languages
+#define wxUSE_PRINTF_POS_PARAMS 1
+
+
+// ----------------------------------------------------------------------------
+// Interoperability with the standard library.
+// ----------------------------------------------------------------------------
+
+// Set wxUSE_STL to 1 to enable maximal interoperability with the standard
+// library, even at the cost of backwards compatibility.
+//
+// Default is 0
+//
+// Recommended setting: 0 as the options below already provide a relatively
+// good level of interoperability and changing this option arguably isn't worth
+// diverging from the official builds of the library.
+#define wxUSE_STL 0
+
// This is not a real option but is used as the default value for
-// wxUSE_STD_IOSTREAM and wxUSE_STD_STRING.
+// wxUSE_STD_IOSTREAM, wxUSE_STD_STRING and wxUSE_STD_CONTAINERS.
//
// Currently the Digital Mars and Watcom compilers come without standard C++
// library headers by default, wxUSE_STD_STRING can be set to 1 if you do have
#define wxUSE_STD_DEFAULT 1
#endif
+// Use standard C++ containers to implement wxVector<>, wxStack<>, wxDList<>
+// and wxHashXXX<> classes. If disabled, wxWidgets own (mostly compatible but
+// usually more limited) implementations are used which allows to avoid the
+// dependency on the C++ run-time library.
+//
+// Default is 1 if compiler supports it.
+//
+// Recommended setting: 1 unless you use a system without good implementation
+// of STL.
+#define wxUSE_STD_CONTAINERS wxUSE_STD_DEFAULT
+
// Use standard C++ streams if 1 instead of wx streams in some places. If
-// disabled (default), wx streams are used everywhere and wxWidgets doesn't
-// depend on the standard streams library.
+// disabled, wx streams are used everywhere and wxWidgets doesn't depend on the
+// standard streams library.
//
// Notice that enabling this does not replace wx streams with std streams
// everywhere, in a lot of places wx streams are used no matter what.
//
-// Default is 0
+// Default is 1 if compiler supports it.
//
// Recommended setting: 1 if you use the standard streams anyhow and so
// dependency on the standard streams library is not a
// problem
#define wxUSE_STD_IOSTREAM wxUSE_STD_DEFAULT
-// Enable conversion to standard C++ string if 1.
+// Enable minimal interoperability with the standard C++ string class if 1.
+// "Minimal" means that wxString can be constructed from std::string or
+// std::wstring but can't be implicitly converted to them. You need to enable
+// the option below for the latter.
//
// Default is 1 for most compilers.
//
// the standard C++ library at all.
#define wxUSE_STD_STRING wxUSE_STD_DEFAULT
-// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf.
-// Note that if the system's implementation does not support positional
-// parameters, setting this to 1 forces the use of the wxWidgets implementation
-// of wxVsnprintf. The standard vsnprintf() supports positional parameters on
-// many Unix systems but usually doesn't under Windows.
+// Make wxString as much interchangeable with std::[w]string as possible, in
+// particular allow implicit conversion of wxString to either of these classes.
+// This comes at a price (or a benefit, depending on your point of view) of not
+// allowing implicit conversion to "const char *" and "const wchar_t *".
//
-// Positional parameters are very useful when translating a program since using
-// them in formatting strings allow translators to correctly reorder the
-// translated sentences.
+// Because a lot of existing code relies on these conversions, this option is
+// disabled by default but can be enabled for your build if you don't care
+// about compatibility.
//
-// Default is 1
+// Default is 0 if wxUSE_STL has its default value or 1 if it is enabled.
//
-// Recommended setting: 1 if you want to support multiple languages
-#define wxUSE_PRINTF_POS_PARAMS 1
+// Recommended setting: 0 to remain compatible with the official builds of
+// wxWidgets.
+#define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL
+
// ----------------------------------------------------------------------------
// non GUI features selection
// Recommended setting: 0 (this is still work in progress...)
#define wxUSE_EXTENDED_RTTI 0
-// Set wxUSE_STL to 1 to derive wxList(Foo) and wxArray(Foo) from
-// std::list<Foo*> and std::vector<Foo*>, with a compatibility interface,
-// and for wxHashMap to be implemented with templates.
-//
-// Default is 0
-//
-// Recommended setting: YMMV
-#define wxUSE_STL 0
-
// Support for message/error logging. This includes wxLogXXX() functions and
// wxLog and derived classes. Don't set this to 0 unless you really know what
// you are doing.
// Recommended setting: 1 as setting it to 0 disables many other things
#define wxUSE_STREAMS 1
+// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf.
+// Note that if the system's implementation does not support positional
+// parameters, setting this to 1 forces the use of the wxWidgets implementation
+// of wxVsnprintf. The standard vsnprintf() supports positional parameters on
+// many Unix systems but usually doesn't under Windows.
+//
+// Positional parameters are very useful when translating a program since using
+// them in formatting strings allow translators to correctly reorder the
+// translated sentences.
+//
+// Default is 1
+//
+// Recommended setting: 1 if you want to support multiple languages
+#define wxUSE_PRINTF_POS_PARAMS 1
+
+
+// ----------------------------------------------------------------------------
+// Interoperability with the standard library.
+// ----------------------------------------------------------------------------
+
+// Set wxUSE_STL to 1 to enable maximal interoperability with the standard
+// library, even at the cost of backwards compatibility.
+//
+// Default is 0
+//
+// Recommended setting: 0 as the options below already provide a relatively
+// good level of interoperability and changing this option arguably isn't worth
+// diverging from the official builds of the library.
+#define wxUSE_STL 0
+
// This is not a real option but is used as the default value for
-// wxUSE_STD_IOSTREAM and wxUSE_STD_STRING.
+// wxUSE_STD_IOSTREAM, wxUSE_STD_STRING and wxUSE_STD_CONTAINERS.
//
// Currently the Digital Mars and Watcom compilers come without standard C++
// library headers by default, wxUSE_STD_STRING can be set to 1 if you do have
#define wxUSE_STD_DEFAULT 1
#endif
+// Use standard C++ containers to implement wxVector<>, wxStack<>, wxDList<>
+// and wxHashXXX<> classes. If disabled, wxWidgets own (mostly compatible but
+// usually more limited) implementations are used which allows to avoid the
+// dependency on the C++ run-time library.
+//
+// Default is 1 if compiler supports it.
+//
+// Recommended setting: 1 unless you use a system without good implementation
+// of STL.
+#define wxUSE_STD_CONTAINERS wxUSE_STD_DEFAULT
+
// Use standard C++ streams if 1 instead of wx streams in some places. If
-// disabled (default), wx streams are used everywhere and wxWidgets doesn't
-// depend on the standard streams library.
+// disabled, wx streams are used everywhere and wxWidgets doesn't depend on the
+// standard streams library.
//
// Notice that enabling this does not replace wx streams with std streams
// everywhere, in a lot of places wx streams are used no matter what.
//
-// Default is 0
+// Default is 1 if compiler supports it.
//
// Recommended setting: 1 if you use the standard streams anyhow and so
// dependency on the standard streams library is not a
// problem
#define wxUSE_STD_IOSTREAM wxUSE_STD_DEFAULT
-// Enable conversion to standard C++ string if 1.
+// Enable minimal interoperability with the standard C++ string class if 1.
+// "Minimal" means that wxString can be constructed from std::string or
+// std::wstring but can't be implicitly converted to them. You need to enable
+// the option below for the latter.
//
// Default is 1 for most compilers.
//
// the standard C++ library at all.
#define wxUSE_STD_STRING wxUSE_STD_DEFAULT
-// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf.
-// Note that if the system's implementation does not support positional
-// parameters, setting this to 1 forces the use of the wxWidgets implementation
-// of wxVsnprintf. The standard vsnprintf() supports positional parameters on
-// many Unix systems but usually doesn't under Windows.
+// Make wxString as much interchangeable with std::[w]string as possible, in
+// particular allow implicit conversion of wxString to either of these classes.
+// This comes at a price (or a benefit, depending on your point of view) of not
+// allowing implicit conversion to "const char *" and "const wchar_t *".
//
-// Positional parameters are very useful when translating a program since using
-// them in formatting strings allow translators to correctly reorder the
-// translated sentences.
+// Because a lot of existing code relies on these conversions, this option is
+// disabled by default but can be enabled for your build if you don't care
+// about compatibility.
//
-// Default is 1
+// Default is 0 if wxUSE_STL has its default value or 1 if it is enabled.
//
-// Recommended setting: 1 if you want to support multiple languages
-#define wxUSE_PRINTF_POS_PARAMS 1
+// Recommended setting: 0 to remain compatible with the official builds of
+// wxWidgets.
+#define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL
+
// ----------------------------------------------------------------------------
// non GUI features selection
// Recommended setting: 0 (this is still work in progress...)
#define wxUSE_EXTENDED_RTTI 0
-// Set wxUSE_STL to 1 to derive wxList(Foo) and wxArray(Foo) from
-// std::list<Foo*> and std::vector<Foo*>, with a compatibility interface,
-// and for wxHashMap to be implemented with templates.
-//
-// Default is 0
-//
-// Recommended setting: YMMV
-#define wxUSE_STL 0
-
// Support for message/error logging. This includes wxLogXXX() functions and
// wxLog and derived classes. Don't set this to 0 unless you really know what
// you are doing.
// Recommended setting: 1 as setting it to 0 disables many other things
#define wxUSE_STREAMS 1
+// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf.
+// Note that if the system's implementation does not support positional
+// parameters, setting this to 1 forces the use of the wxWidgets implementation
+// of wxVsnprintf. The standard vsnprintf() supports positional parameters on
+// many Unix systems but usually doesn't under Windows.
+//
+// Positional parameters are very useful when translating a program since using
+// them in formatting strings allow translators to correctly reorder the
+// translated sentences.
+//
+// Default is 1
+//
+// Recommended setting: 1 if you want to support multiple languages
+#define wxUSE_PRINTF_POS_PARAMS 1
+
+
+// ----------------------------------------------------------------------------
+// Interoperability with the standard library.
+// ----------------------------------------------------------------------------
+
+// Set wxUSE_STL to 1 to enable maximal interoperability with the standard
+// library, even at the cost of backwards compatibility.
+//
+// Default is 0
+//
+// Recommended setting: 0 as the options below already provide a relatively
+// good level of interoperability and changing this option arguably isn't worth
+// diverging from the official builds of the library.
+#define wxUSE_STL 0
+
// This is not a real option but is used as the default value for
-// wxUSE_STD_IOSTREAM and wxUSE_STD_STRING.
+// wxUSE_STD_IOSTREAM, wxUSE_STD_STRING and wxUSE_STD_CONTAINERS.
//
// Currently the Digital Mars and Watcom compilers come without standard C++
// library headers by default, wxUSE_STD_STRING can be set to 1 if you do have
#define wxUSE_STD_DEFAULT 1
#endif
+// Use standard C++ containers to implement wxVector<>, wxStack<>, wxDList<>
+// and wxHashXXX<> classes. If disabled, wxWidgets own (mostly compatible but
+// usually more limited) implementations are used which allows to avoid the
+// dependency on the C++ run-time library.
+//
+// Default is 1 if compiler supports it.
+//
+// Recommended setting: 1 unless you use a system without good implementation
+// of STL.
+#define wxUSE_STD_CONTAINERS wxUSE_STD_DEFAULT
+
// Use standard C++ streams if 1 instead of wx streams in some places. If
-// disabled (default), wx streams are used everywhere and wxWidgets doesn't
-// depend on the standard streams library.
+// disabled, wx streams are used everywhere and wxWidgets doesn't depend on the
+// standard streams library.
//
// Notice that enabling this does not replace wx streams with std streams
// everywhere, in a lot of places wx streams are used no matter what.
//
-// Default is 0
+// Default is 1 if compiler supports it.
//
// Recommended setting: 1 if you use the standard streams anyhow and so
// dependency on the standard streams library is not a
// problem
#define wxUSE_STD_IOSTREAM wxUSE_STD_DEFAULT
-// Enable conversion to standard C++ string if 1.
+// Enable minimal interoperability with the standard C++ string class if 1.
+// "Minimal" means that wxString can be constructed from std::string or
+// std::wstring but can't be implicitly converted to them. You need to enable
+// the option below for the latter.
//
// Default is 1 for most compilers.
//
// the standard C++ library at all.
#define wxUSE_STD_STRING wxUSE_STD_DEFAULT
-// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf.
-// Note that if the system's implementation does not support positional
-// parameters, setting this to 1 forces the use of the wxWidgets implementation
-// of wxVsnprintf. The standard vsnprintf() supports positional parameters on
-// many Unix systems but usually doesn't under Windows.
+// Make wxString as much interchangeable with std::[w]string as possible, in
+// particular allow implicit conversion of wxString to either of these classes.
+// This comes at a price (or a benefit, depending on your point of view) of not
+// allowing implicit conversion to "const char *" and "const wchar_t *".
//
-// Positional parameters are very useful when translating a program since using
-// them in formatting strings allow translators to correctly reorder the
-// translated sentences.
+// Because a lot of existing code relies on these conversions, this option is
+// disabled by default but can be enabled for your build if you don't care
+// about compatibility.
//
-// Default is 1
+// Default is 0 if wxUSE_STL has its default value or 1 if it is enabled.
//
-// Recommended setting: 1 if you want to support multiple languages
-#define wxUSE_PRINTF_POS_PARAMS 1
+// Recommended setting: 0 to remain compatible with the official builds of
+// wxWidgets.
+#define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL
+
// ----------------------------------------------------------------------------
// non GUI features selection
// Recommended setting: 0 (this is still work in progress...)
#define wxUSE_EXTENDED_RTTI 0
-// Set wxUSE_STL to 1 to derive wxList(Foo) and wxArray(Foo) from
-// std::list<Foo*> and std::vector<Foo*>, with a compatibility interface,
-// and for wxHashMap to be implemented with templates.
-//
-// Default is 0
-//
-// Recommended setting: YMMV
-#define wxUSE_STL 0
-
// Support for message/error logging. This includes wxLogXXX() functions and
// wxLog and derived classes. Don't set this to 0 unless you really know what
// you are doing.
// Recommended setting: 1 as setting it to 0 disables many other things
#define wxUSE_STREAMS 1
+// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf.
+// Note that if the system's implementation does not support positional
+// parameters, setting this to 1 forces the use of the wxWidgets implementation
+// of wxVsnprintf. The standard vsnprintf() supports positional parameters on
+// many Unix systems but usually doesn't under Windows.
+//
+// Positional parameters are very useful when translating a program since using
+// them in formatting strings allow translators to correctly reorder the
+// translated sentences.
+//
+// Default is 1
+//
+// Recommended setting: 1 if you want to support multiple languages
+#define wxUSE_PRINTF_POS_PARAMS 1
+
+
+// ----------------------------------------------------------------------------
+// Interoperability with the standard library.
+// ----------------------------------------------------------------------------
+
+// Set wxUSE_STL to 1 to enable maximal interoperability with the standard
+// library, even at the cost of backwards compatibility.
+//
+// Default is 0
+//
+// Recommended setting: 0 as the options below already provide a relatively
+// good level of interoperability and changing this option arguably isn't worth
+// diverging from the official builds of the library.
+#define wxUSE_STL 0
+
// This is not a real option but is used as the default value for
-// wxUSE_STD_IOSTREAM and wxUSE_STD_STRING.
+// wxUSE_STD_IOSTREAM, wxUSE_STD_STRING and wxUSE_STD_CONTAINERS.
//
// Currently the Digital Mars and Watcom compilers come without standard C++
// library headers by default, wxUSE_STD_STRING can be set to 1 if you do have
#define wxUSE_STD_DEFAULT 1
#endif
+// Use standard C++ containers to implement wxVector<>, wxStack<>, wxDList<>
+// and wxHashXXX<> classes. If disabled, wxWidgets own (mostly compatible but
+// usually more limited) implementations are used which allows to avoid the
+// dependency on the C++ run-time library.
+//
+// Default is 1 if compiler supports it.
+//
+// Recommended setting: 1 unless you use a system without good implementation
+// of STL.
+#define wxUSE_STD_CONTAINERS wxUSE_STD_DEFAULT
+
// Use standard C++ streams if 1 instead of wx streams in some places. If
-// disabled (default), wx streams are used everywhere and wxWidgets doesn't
-// depend on the standard streams library.
+// disabled, wx streams are used everywhere and wxWidgets doesn't depend on the
+// standard streams library.
//
// Notice that enabling this does not replace wx streams with std streams
// everywhere, in a lot of places wx streams are used no matter what.
//
-// Default is 0
+// Default is 1 if compiler supports it.
//
// Recommended setting: 1 if you use the standard streams anyhow and so
// dependency on the standard streams library is not a
// problem
#define wxUSE_STD_IOSTREAM wxUSE_STD_DEFAULT
-// Enable conversion to standard C++ string if 1.
+// Enable minimal interoperability with the standard C++ string class if 1.
+// "Minimal" means that wxString can be constructed from std::string or
+// std::wstring but can't be implicitly converted to them. You need to enable
+// the option below for the latter.
//
// Default is 1 for most compilers.
//
// the standard C++ library at all.
#define wxUSE_STD_STRING wxUSE_STD_DEFAULT
-// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf.
-// Note that if the system's implementation does not support positional
-// parameters, setting this to 1 forces the use of the wxWidgets implementation
-// of wxVsnprintf. The standard vsnprintf() supports positional parameters on
-// many Unix systems but usually doesn't under Windows.
+// Make wxString as much interchangeable with std::[w]string as possible, in
+// particular allow implicit conversion of wxString to either of these classes.
+// This comes at a price (or a benefit, depending on your point of view) of not
+// allowing implicit conversion to "const char *" and "const wchar_t *".
//
-// Positional parameters are very useful when translating a program since using
-// them in formatting strings allow translators to correctly reorder the
-// translated sentences.
+// Because a lot of existing code relies on these conversions, this option is
+// disabled by default but can be enabled for your build if you don't care
+// about compatibility.
//
-// Default is 1
+// Default is 0 if wxUSE_STL has its default value or 1 if it is enabled.
//
-// Recommended setting: 1 if you want to support multiple languages
-#define wxUSE_PRINTF_POS_PARAMS 1
+// Recommended setting: 0 to remain compatible with the official builds of
+// wxWidgets.
+#define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL
+
// ----------------------------------------------------------------------------
// non GUI features selection
#include "wx/vector.h"
-#if wxUSE_STL
+#if wxUSE_STD_CONTAINERS
#include <stack>
#define wxStack std::stack
-#else // !wxUSE_STL
+#else // !wxUSE_STD_CONTAINERS
// Notice that unlike std::stack, wxStack currently always uses wxVector and
// can't be used with any other underlying container type.
container_type m_cont;
};
-#endif // wxUSE_STL/!wxUSE_STL
+#endif // wxUSE_STD_CONTAINERS/!wxUSE_STD_CONTAINERS
// Deprecated macro-based class for compatibility only, don't use any more.
}
#endif // wxUSE_STRING_POS_CACHE
- // even if we're not built with wxUSE_STL == 1 it is very convenient to allow
- // implicit conversions from std::string to wxString and vice verse as this
- // allows to use the same strings in non-GUI and GUI code, however we don't
- // want to unconditionally add this ctor as it would make wx lib dependent on
- // libstdc++ on some Linux versions which is bad, so instead we ask the
- // client code to define this wxUSE_STD_STRING symbol if they need it
+ // even if we're not built with wxUSE_STD_STRING_CONV_IN_WXSTRING == 1 it is
+ // very convenient to allow implicit conversions from std::string to wxString
+ // and vice verse as this allows to use the same strings in non-GUI and GUI
+ // code, however we don't want to unconditionally add this ctor as it would
+ // make wx lib dependent on libstdc++ on some Linux versions which is bad, so
+ // instead we ask the client code to define this wxUSE_STD_STRING symbol if
+ // they need it
#if wxUSE_STD_STRING
#if wxUSE_UNICODE_WCHAR
wxString(const wxStdWideString& str) : m_impl(str) {}
#endif
#endif // wxUSE_STD_STRING
- // Unlike ctor from std::string, we provide conversion to std::string only
- // if wxUSE_STL and not merely wxUSE_STD_STRING (which is on by default),
- // because it conflicts with operator const char/wchar_t* but we still
- // provide explicit conversions to std::[w]string for convenience in any case
+ // Also always provide explicit conversions to std::[w]string in any case,
+ // see below for the implicit ones.
#if wxUSE_STD_STRING
// We can avoid a copy if we already use this string type internally,
// otherwise we create a copy on the fly:
}
#endif
-#if wxUSE_STL
- // In wxUSE_STL case we also provide implicit conversions as there is no
- // ambiguity with the const char/wchar_t* ones as they are disabled in this
- // build (for consistency with std::basic_string<>)
+#if wxUSE_STD_STRING_CONV_IN_WXSTRING
+ // Implicit conversions to std::[w]string are not provided by default as
+ // they conflict with the implicit conversions to "const char/wchar_t *"
+ // which we use for backwards compatibility but do provide them if
+ // explicitly requested.
operator wxStringToStdStringRetType() const { return ToStdString(); }
operator wxStringToStdWstringRetType() const { return ToStdWstring(); }
-#endif // wxUSE_STL
+#endif // wxUSE_STD_STRING_CONV_IN_WXSTRING
#undef wxStringToStdStringRetType
#undef wxStringToStdWstringRetType
operator wxCStrData() const { return c_str(); }
// the first two operators conflict with operators for conversion to
- // std::string and they must be disabled in STL build; the next one only
- // makes sense if conversions to char* are also defined and not defining it
- // in STL build also helps us to get more clear error messages for the code
- // which relies on implicit conversion to char* in STL build
-#if !wxUSE_STL
+ // std::string and they must be disabled if those conversions are enabled;
+ // the next one only makes sense if conversions to char* are also defined
+ // and not defining it in STL build also helps us to get more clear error
+ // messages for the code which relies on implicit conversion to char* in
+ // STL build
+#if !wxUSE_STD_STRING_CONV_IN_WXSTRING
operator const char*() const { return c_str(); }
operator const wchar_t*() const { return c_str(); }
// wxWidgets versions: this is the same as conversion to const char * so it
// may fail!
operator const void*() const { return c_str(); }
-#endif // wxUSE_STL
+#endif // !wxUSE_STD_STRING_CONV_IN_WXSTRING
// identical to c_str(), for MFC compatibility
const wxCStrData GetData() const { return c_str(); }
/*
This header implements std::string-like string class, wxStringImpl, that is
- used by wxString to store the data. Alternatively, if wxUSE_STL=1,
+ used by wxString to store the data. Alternatively, if wxUSE_STD_STRING=1,
wxStringImpl is just a typedef to std:: string class.
*/
// ----------------------------------------------------------------------------
-// deal with STL/non-STL/non-STL-but-wxUSE_STD_STRING
+// deal with various build options
// ----------------------------------------------------------------------------
-// using STL implies using std::string
-#if wxUSE_STL
- #undef wxUSE_STD_STRING
- #define wxUSE_STD_STRING 1
-#endif
-
// we use STL-based string internally if we use std::string at all now, there
// should be no reason to prefer our internal implement but if you really need
// it you can predefine wxUSE_STL_BASED_WXSTRING as 0 when building the library
// Recommended setting: 0 (this is still work in progress...)
#define wxUSE_EXTENDED_RTTI 0
-// Set wxUSE_STL to 1 to derive wxList(Foo) and wxArray(Foo) from
-// std::list<Foo*> and std::vector<Foo*>, with a compatibility interface,
-// and for wxHashMap to be implemented with templates.
-//
-// Default is 0
-//
-// Recommended setting: YMMV
-#define wxUSE_STL 0
-
// Support for message/error logging. This includes wxLogXXX() functions and
// wxLog and derived classes. Don't set this to 0 unless you really know what
// you are doing.
// Recommended setting: 1 as setting it to 0 disables many other things
#define wxUSE_STREAMS 1
+// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf.
+// Note that if the system's implementation does not support positional
+// parameters, setting this to 1 forces the use of the wxWidgets implementation
+// of wxVsnprintf. The standard vsnprintf() supports positional parameters on
+// many Unix systems but usually doesn't under Windows.
+//
+// Positional parameters are very useful when translating a program since using
+// them in formatting strings allow translators to correctly reorder the
+// translated sentences.
+//
+// Default is 1
+//
+// Recommended setting: 1 if you want to support multiple languages
+#define wxUSE_PRINTF_POS_PARAMS 1
+
+
+// ----------------------------------------------------------------------------
+// Interoperability with the standard library.
+// ----------------------------------------------------------------------------
+
+// Set wxUSE_STL to 1 to enable maximal interoperability with the standard
+// library, even at the cost of backwards compatibility.
+//
+// Default is 0
+//
+// Recommended setting: 0 as the options below already provide a relatively
+// good level of interoperability and changing this option arguably isn't worth
+// diverging from the official builds of the library.
+#define wxUSE_STL 0
+
// This is not a real option but is used as the default value for
-// wxUSE_STD_IOSTREAM and wxUSE_STD_STRING.
+// wxUSE_STD_IOSTREAM, wxUSE_STD_STRING and wxUSE_STD_CONTAINERS.
//
// Currently the Digital Mars and Watcom compilers come without standard C++
// library headers by default, wxUSE_STD_STRING can be set to 1 if you do have
#define wxUSE_STD_DEFAULT 1
#endif
+// Use standard C++ containers to implement wxVector<>, wxStack<>, wxDList<>
+// and wxHashXXX<> classes. If disabled, wxWidgets own (mostly compatible but
+// usually more limited) implementations are used which allows to avoid the
+// dependency on the C++ run-time library.
+//
+// Default is 1 if compiler supports it.
+//
+// Recommended setting: 1 unless you use a system without good implementation
+// of STL.
+#define wxUSE_STD_CONTAINERS wxUSE_STD_DEFAULT
+
// Use standard C++ streams if 1 instead of wx streams in some places. If
-// disabled (default), wx streams are used everywhere and wxWidgets doesn't
-// depend on the standard streams library.
+// disabled, wx streams are used everywhere and wxWidgets doesn't depend on the
+// standard streams library.
//
// Notice that enabling this does not replace wx streams with std streams
// everywhere, in a lot of places wx streams are used no matter what.
//
-// Default is 0
+// Default is 1 if compiler supports it.
//
// Recommended setting: 1 if you use the standard streams anyhow and so
// dependency on the standard streams library is not a
// problem
#define wxUSE_STD_IOSTREAM wxUSE_STD_DEFAULT
-// Enable conversion to standard C++ string if 1.
+// Enable minimal interoperability with the standard C++ string class if 1.
+// "Minimal" means that wxString can be constructed from std::string or
+// std::wstring but can't be implicitly converted to them. You need to enable
+// the option below for the latter.
//
// Default is 1 for most compilers.
//
// the standard C++ library at all.
#define wxUSE_STD_STRING wxUSE_STD_DEFAULT
-// Support for positional parameters (e.g. %1$d, %2$s ...) in wxVsnprintf.
-// Note that if the system's implementation does not support positional
-// parameters, setting this to 1 forces the use of the wxWidgets implementation
-// of wxVsnprintf. The standard vsnprintf() supports positional parameters on
-// many Unix systems but usually doesn't under Windows.
+// Make wxString as much interchangeable with std::[w]string as possible, in
+// particular allow implicit conversion of wxString to either of these classes.
+// This comes at a price (or a benefit, depending on your point of view) of not
+// allowing implicit conversion to "const char *" and "const wchar_t *".
//
-// Positional parameters are very useful when translating a program since using
-// them in formatting strings allow translators to correctly reorder the
-// translated sentences.
+// Because a lot of existing code relies on these conversions, this option is
+// disabled by default but can be enabled for your build if you don't care
+// about compatibility.
//
-// Default is 1
+// Default is 0 if wxUSE_STL has its default value or 1 if it is enabled.
//
-// Recommended setting: 1 if you want to support multiple languages
-#define wxUSE_PRINTF_POS_PARAMS 1
+// Recommended setting: 0 to remain compatible with the official builds of
+// wxWidgets.
+#define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL
+
// ----------------------------------------------------------------------------
// non GUI features selection
#include "wx/defs.h"
-#if wxUSE_STL
+#if wxUSE_STD_CONTAINERS
#include <vector>
#include <algorithm>
std::sort(v.begin(), v.end());
}
-#else // !wxUSE_STL
+#else // !wxUSE_STD_CONTAINERS
#include "wx/utils.h"
#include "wx/scopeguard.h"
-#endif // wxUSE_STL/!wxUSE_STL
+#endif // wxUSE_STD_CONTAINERS/!wxUSE_STD_CONTAINERS
#if WXWIN_COMPATIBILITY_2_8
#define WX_DECLARE_VECTORBASE(obj, cls) typedef wxVector<obj> cls
#define wxUSE_EXTENDED_RTTI 0
-#define wxUSE_STL 0
-
#define wxUSE_LOG 0
#define wxUSE_LOGWINDOW 0
#define wxUSE_STREAMS 0
+#define wxUSE_PRINTF_POS_PARAMS 0
+
+
+
+#define wxUSE_STL 0
+
#if defined(__DMC__) || defined(__WATCOMC__) \
|| (defined(_MSC_VER) && _MSC_VER < 1200)
#define wxUSE_STD_DEFAULT 0
#define wxUSE_STD_DEFAULT 0
#endif
+#define wxUSE_STD_CONTAINERS wxUSE_STD_DEFAULT
+
#define wxUSE_STD_IOSTREAM wxUSE_STD_DEFAULT
#define wxUSE_STD_STRING wxUSE_STD_DEFAULT
-#define wxUSE_PRINTF_POS_PARAMS 0
+#define wxUSE_STD_STRING_CONV_IN_WXSTRING wxUSE_STL
+
#define wxUSE_LONGLONG 0
wxArrayString::wxArrayString(size_t sz, const char** a)
{
-#if !wxUSE_STL
+#if !wxUSE_STD_CONTAINERS
Init(false);
#endif
for (size_t i=0; i < sz; i++)
wxArrayString::wxArrayString(size_t sz, const wchar_t** a)
{
-#if !wxUSE_STL
+#if !wxUSE_STD_CONTAINERS
Init(false);
#endif
for (size_t i=0; i < sz; i++)
wxArrayString::wxArrayString(size_t sz, const wxString* a)
{
-#if !wxUSE_STL
+#if !wxUSE_STD_CONTAINERS
Init(false);
#endif
for (size_t i=0; i < sz; i++)
Add(a[i]);
}
-#if !wxUSE_STL
+#if !wxUSE_STD_CONTAINERS
// size increment = min(50% of current size, ARRAY_MAXSIZE_INCREMENT)
#define ARRAY_MAXSIZE_INCREMENT 4096
return true;
}
-#endif // !wxUSE_STL
+#endif // !wxUSE_STD_CONTAINERS
// ===========================================================================
// wxJoin and wxSplit
{
wxCommand *redoCommand = NULL;
wxList::compatibility_iterator redoNode
-#if !wxUSE_STL
+#if !wxUSE_STD_CONTAINERS
= NULL // just to avoid warnings
-#endif // !wxUSE_STL
+#endif // !wxUSE_STD_CONTAINERS
;
if ( m_currentCommand )
wx_spline_add_point(x1, y1);
while ((node = node->GetNext())
-#if !wxUSE_STL
+#if !wxUSE_STD_CONTAINERS
!= NULL
-#endif // !wxUSE_STL
+#endif // !wxUSE_STD_CONTAINERS
)
{
p = node->GetData();
path.MoveToPoint( x1 , y1 );
path.AddLineToPoint( cx1 , cy1 );
-#if !wxUSE_STL
+#if !wxUSE_STD_CONTAINERS
while ((node = node->GetNext()) != NULL)
#else
while ((node = node->GetNext()))
-#endif // !wxUSE_STL
+#endif // !wxUSE_STD_CONTAINERS
{
p = node->GetData();
#include <stdlib.h>
#include <string.h> // for memmove
-#if !wxUSE_STL
+#if !wxUSE_STD_CONTAINERS
// we cast the value to long from which we cast it to void * in IndexForInsert:
// this can't work if the pointers are not big enough
#pragma warning(pop)
#endif
-#else // wxUSE_STL
+#else // wxUSE_STD_CONTAINERS
#include "wx/arrstr.h"
return it - begin();
}
-#endif // !wxUSE_STL/wxUSE_STL
+#endif // !wxUSE_STD_CONTAINERS/wxUSE_STD_CONTAINERS
#include "wx/crt.h"
#endif
-#if !wxUSE_STL
+#if !wxUSE_STD_CONTAINERS
// =============================================================================
// implementation
#endif // wxLIST_COMPATIBILITY
-#else // wxUSE_STL = 1
+#else // wxUSE_STD_CONTAINERS = 1
#include "wx/listimpl.cpp"
WX_DEFINE_LIST(wxObjectList)
-// with wxUSE_STL wxStringList contains wxString objects, not pointers
+// with wxUSE_STD_CONTAINERS wxStringList contains wxString objects, not pointers
void _WX_LIST_HELPER_wxStringListBase::DeleteFunction( wxString WXUNUSED(X) )
{
}
wxStringListBase::BaseListType wxStringListBase::EmptyList;
-#endif // !wxUSE_STL
+#endif // !wxUSE_STD_CONTAINERS
// list classes implementation
// ----------------------------------------------------------------------------
-#if wxUSE_STL
+#if wxUSE_STD_CONTAINERS
#include "wx/listimpl.cpp"
WX_DEFINE_LIST(wxWindowList)
-#else // !wxUSE_STL
+#else // !wxUSE_STD_CONTAINERS
void wxWindowListNode::DeleteData()
{
delete (wxWindow *)GetData();
}
-#endif // wxUSE_STL/!wxUSE_STL
+#endif // wxUSE_STD_CONTAINERS/!wxUSE_STD_CONTAINERS
// ----------------------------------------------------------------------------
// borders
wxWindowList::compatibility_iterator i = siblings.Find(win);
wxCHECK_RET( i, wxT("MoveBefore/AfterInTabOrder(): win is not a sibling") );
- // unfortunately, when wxUSE_STL == 1 DetachNode() is not implemented so we
- // can't just move the node around
+ // unfortunately, when wxUSE_STD_CONTAINERS == 1 DetachNode() is not
+ // implemented so we can't just move the node around
wxWindow *self = (wxWindow *)this;
siblings.DeleteObject(self);
if ( move == OrderAfter )
lppt[ bezier_pos ] = lppt[ bezier_pos-1 ];
bezier_pos++;
-#if !wxUSE_STL
+#if !wxUSE_STD_CONTAINERS
while ((node = node->GetNext()) != NULL)
#else
while ((node = node->GetNext()))
-#endif // !wxUSE_STL
+#endif // !wxUSE_STD_CONTAINERS
{
p = (wxPoint *)node->GetData();
x1 = x2;
MacPostControlCreate( pos, size );
-#if !wxUSE_STL
+#if !wxUSE_STD_CONTAINERS
if ( style & wxCB_SORT )
// autosort
m_strings = wxArrayString( 1 );
{
unsigned int idx;
-#if wxUSE_STL
+#if wxUSE_STD_CONTAINERS
if ( IsSorted() )
{
wxArrayString::iterator
m_strings.insert( insertPoint, items[i] );
}
else
-#endif // wxUSE_STL
+#endif // wxUSE_STD_CONTAINERS
{
idx = pos;
m_strings.Insert( items[i], idx );
int wxChoice::FindString( const wxString& s, bool bCase ) const
{
-#if !wxUSE_STL
+#if !wxUSE_STD_CONTAINERS
// Avoid assert for non-default args passed to sorted array Index
if ( IsSorted() )
bCase = true;
#else
// If not unicode then just use the widths we have
-#if wxUSE_STL
+#if wxUSE_STD_CONTAINERS
std::copy(tpos.begin(), tpos.end(), positions);
#else
memcpy(positions, tpos.begin(), len * sizeof(int));