From da36cbff06c7e265fe05f6919d6faf85ebab6257 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 14 Jan 2017 00:23:12 +0100 Subject: [PATCH] Don't over promise in wxItemContainer documentation It only accepts std::vector, not std::vector for any type convertible to wxString as both the documentation and the code misleadingly claimed. --- include/wx/arrstr.h | 5 ++--- include/wx/ctrlsub.h | 9 +++------ interface/wx/ctrlsub.h | 21 +++------------------ 3 files changed, 8 insertions(+), 27 deletions(-) diff --git a/include/wx/arrstr.h b/include/wx/arrstr.h index 9e2711acd9..42fa401ca9 100644 --- a/include/wx/arrstr.h +++ b/include/wx/arrstr.h @@ -479,9 +479,8 @@ public: } #if wxUSE_STD_CONTAINERS_COMPATIBLY - // construct an adapter from a vector of strings (of any type) - template - wxArrayStringsAdapter(const std::vector& strings) + // construct an adapter from a vector of strings + wxArrayStringsAdapter(const std::vector& strings) : m_type(wxSTRING_POINTER), m_size(strings.size()) { m_data.ptr = &strings[0]; diff --git a/include/wx/ctrlsub.h b/include/wx/ctrlsub.h index b934d2376f..7897268732 100644 --- a/include/wx/ctrlsub.h +++ b/include/wx/ctrlsub.h @@ -221,8 +221,7 @@ public: { return AppendItems(wxArrayStringsAdapter(n, items), clientData); } #if wxUSE_STD_CONTAINERS_COMPATIBLY - template - int Append(const std::vector& items) + int Append(const std::vector& items) { return AppendItems(items); } #endif // wxUSE_STD_CONTAINERS_COMPATIBLY @@ -266,8 +265,7 @@ public: { return InsertItems(wxArrayStringsAdapter(n, items), pos, clientData); } #if wxUSE_STD_CONTAINERS_COMPATIBLY - template - int Insert(const std::vector& items, unsigned int pos) + int Insert(const std::vector& items, unsigned int pos) { return InsertItems(items, pos); } #endif // wxUSE_STD_CONTAINERS_COMPATIBLY @@ -288,8 +286,7 @@ public: { Clear(); Append(n, items, clientData); } #if wxUSE_STD_CONTAINERS_COMPATIBLY - template - void Set(const std::vector& items) + void Set(const std::vector& items) { Clear(); Append(items); } #endif // wxUSE_STD_CONTAINERS_COMPATIBLY diff --git a/interface/wx/ctrlsub.h b/interface/wx/ctrlsub.h index 00b718ad8a..3e1d8d0da6 100644 --- a/interface/wx/ctrlsub.h +++ b/interface/wx/ctrlsub.h @@ -259,14 +259,9 @@ public: This is the same as the overload taking wxArrayString, except that it works with the standard vector container. - The template argument @c T can be any type convertible to wxString, - including wxString itself but also @c std::string, @c char* or @c - wchar_t*. - @since 3.1.0 */ - template - int Append(const std::vector& items); + int Append(const std::vector& items); /** Appends several items at once into the control. @@ -541,14 +536,9 @@ public: This is the same as the overload taking wxArrayString, except that it works with the standard vector container. - The template argument @c T can be any type convertible to wxString, - including wxString itself but also @c std::string, @c char* or @c - wchar_t*. - @since 3.1.0 */ - template - int Insert(const std::vector& items); + int Insert(const std::vector& items); /** Inserts several items at once into the control. @@ -669,14 +659,9 @@ public: This is the same as the overload taking wxArrayString, except that it works with the standard vector container. - The template argument @c T can be any type convertible to wxString, - including wxString itself but also @c std::string, @c char* or @c - wchar_t*. - @since 3.1.0 */ - template - void Set(const std::vector& items); + void Set(const std::vector& items); /** Replaces the current control contents with the given items.