Fix wxArrayString build error when using c++17 with MSVC
MSVC does not set the correct __cplusplus version, so check MSVC compiler version as well.
This commit is contained in:
@@ -59,7 +59,7 @@ wxArrayString::wxArrayString(size_t sz, const wxString* a)
|
|||||||
|
|
||||||
#include "wx/arrstr.h"
|
#include "wx/arrstr.h"
|
||||||
|
|
||||||
#if __cplusplus >= 201103L
|
#if __cplusplus >= 201103L || wxCHECK_VISUALC_VERSION(14)
|
||||||
|
|
||||||
int wxArrayString::Index(const wxString& str, bool bCase, bool WXUNUSED(bFromEnd)) const
|
int wxArrayString::Index(const wxString& str, bool bCase, bool WXUNUSED(bFromEnd)) const
|
||||||
{
|
{
|
||||||
@@ -153,7 +153,7 @@ wxStringCompareLess<F> wxStringCompare(F f)
|
|||||||
void wxArrayString::Sort(CompareFunction function)
|
void wxArrayString::Sort(CompareFunction function)
|
||||||
{
|
{
|
||||||
std::sort(begin(), end(),
|
std::sort(begin(), end(),
|
||||||
#if __cplusplus >= 201103L
|
#if __cplusplus >= 201103L || wxCHECK_VISUALC_VERSION(14)
|
||||||
[function](const wxString& s1, const wxString& s2)
|
[function](const wxString& s1, const wxString& s2)
|
||||||
{
|
{
|
||||||
return function(s1, s2) < 0;
|
return function(s1, s2) < 0;
|
||||||
@@ -185,7 +185,7 @@ int wxSortedArrayString::Index(const wxString& str,
|
|||||||
|
|
||||||
wxSortedArrayString::const_iterator
|
wxSortedArrayString::const_iterator
|
||||||
it = std::lower_bound(begin(), end(), str,
|
it = std::lower_bound(begin(), end(), str,
|
||||||
#if __cplusplus >= 201103L
|
#if __cplusplus >= 201103L || wxCHECK_VISUALC_VERSION(14)
|
||||||
[](const wxString& s1, const wxString& s2)
|
[](const wxString& s1, const wxString& s2)
|
||||||
{
|
{
|
||||||
return s1 < s2;
|
return s1 < s2;
|
||||||
|
Reference in New Issue
Block a user