fix(LinearHashTable): fix std::iterator deprecated warnings; test warnings #4235

This commit is contained in:
Aleksandar Fabijanic 2023-10-29 14:44:15 +01:00
parent 439acf1924
commit 8c4b166737
3 changed files with 20 additions and 5 deletions

View File

@ -215,6 +215,16 @@
// Enable usage of Poco::Mutex and Poco::FastMutex
// as wrappers for std::recursive_mutex and std::mutex
#ifndef POCO_ENABLE_STD_MUTEX
// #define POCO_ENABLE_STD_MUTEX
// #define POCO_ENABLE_STD_MUTEX
#endif
#define POCO_HAVE_CPP17_COMPILER (__cplusplus >= 201703L)
// Enable usage of SQL parser in Poco::Data
#ifndef POCO_DATA_ENABLE_SQL_PARSER
#ifdef POCO_HAVE_CPP17_COMPILER
#define POCO_DATA_ENABLE_SQL_PARSER
#endif
#endif
#endif // Foundation_Config_INCLUDED

View File

@ -23,7 +23,6 @@
#include <functional>
#include <algorithm>
#include <vector>
#include <utility>
#include <cstddef>
@ -67,9 +66,15 @@ public:
typedef typename Bucket::iterator BucketIterator;
typedef typename BucketVec::iterator BucketVecIterator;
class ConstIterator: public std::iterator<std::forward_iterator_tag, Value>
class ConstIterator
{
public:
using iterator_category = std::forward_iterator_tag;
using value_type = Value;
using difference_type = ptrdiff_t;
using pointer = Value*;
using reference = Value&;
ConstIterator(): _initialized(false)
{
}

View File

@ -245,7 +245,7 @@ void LinearHashTableTest::testPerformanceInt()
sw.start();
for (int i = 0; i < N; ++i)
{
s.find(i);
auto it = s.find(i);
}
sw.stop();
std::cout << "Find set: " << sw.elapsedSeconds() << std::endl;
@ -322,7 +322,7 @@ void LinearHashTableTest::testPerformanceStr()
sw.start();
for (int i = 0; i < N; ++i)
{
s.find(values[i]);
auto it = s.find(values[i]);
}
sw.stop();
std::cout << "Find set: " << sw.elapsedSeconds() << std::endl;