std::binary_function is deprecated and unnecessary in C++11

This commit is contained in:
Martin Natano
2022-05-31 12:55:03 +02:00
parent f83dd1989d
commit 5f08636ad0
3 changed files with 8 additions and 10 deletions
+1
View File
@@ -16,6 +16,7 @@
#include <ctime>
#include <sstream>
#include <map>
#include <functional>
#include <sys/types.h>
#include <sys/stat.h>
#include <math.h>
+6 -9
View File
@@ -91,8 +91,7 @@ typedef char* PSTR;
// Standard headers needed
#include <string> // basic_string
#include <algorithm> // for_each, etc.
#include <functional> // for StdStringLessNoCase, et al
#include <algorithm> // for_each, etc.
#if defined(WIN32)
#include <malloc.h> // _alloca
@@ -799,25 +798,23 @@ typedef CStdStr<char> CStdStringA; // a better std::string
// -----------------------------------------------------------------------------
// FUNCTIONAL COMPARATORS:
// REMARKS:
// These structs are derived from the std::binary_function template. They
// give us functional classes (which may be used in Standard C++ Library
// collections and algorithms) that perform case-insensitive comparisons of
// CStdString objects. This is useful for maps in which the key may be the
// proper string but in the wrong case.
// These structs give us functional classes (which may be used in
// Standard C++ Library collections and algorithms) that perform
// case-insensitive comparisons of CStdString objects. This is
// useful for maps in which the key may be the proper string but
// in the wrong case.
// -----------------------------------------------------------------------------
#define StdStringLessNoCase SSLNCA
#define StdStringEqualsNoCase SSENCA
struct StdStringLessNoCase
: std::binary_function<CStdStringA, CStdStringA, bool>
{
inline
bool operator()(const CStdStringA& sLeft, const CStdStringA& sRight) const
{ return ssicmp(sLeft.c_str(), sRight.c_str()) < 0; }
};
struct StdStringEqualsNoCase
: std::binary_function<CStdStringA, CStdStringA, bool>
{
inline
bool operator()(const CStdStringA& sLeft, const CStdStringA& sRight) const
+1 -1
View File
@@ -420,7 +420,7 @@ int TimingData::GetSegmentIndexAtRow(TimingSegmentType tst, int iRow ) const
return INVALID_INDEX;
}
struct ts_less : binary_function <TimingSegment*, TimingSegment*, bool>
struct ts_less
{
bool operator() (const TimingSegment *x, const TimingSegment *y) const
{