diff --git a/Foundation/include/Poco/Config.h b/Foundation/include/Poco/Config.h index dfcbf3b25..3a033ec0b 100644 --- a/Foundation/include/Poco/Config.h +++ b/Foundation/include/Poco/Config.h @@ -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 diff --git a/Foundation/include/Poco/LinearHashTable.h b/Foundation/include/Poco/LinearHashTable.h index 7883387ad..5d7c1f856 100644 --- a/Foundation/include/Poco/LinearHashTable.h +++ b/Foundation/include/Poco/LinearHashTable.h @@ -23,7 +23,6 @@ #include #include #include -#include #include @@ -67,9 +66,15 @@ public: typedef typename Bucket::iterator BucketIterator; typedef typename BucketVec::iterator BucketVecIterator; - class ConstIterator: public std::iterator + 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) { } diff --git a/Foundation/testsuite/src/LinearHashTableTest.cpp b/Foundation/testsuite/src/LinearHashTableTest.cpp index 5ad7a87ff..1ac9af36c 100644 --- a/Foundation/testsuite/src/LinearHashTableTest.cpp +++ b/Foundation/testsuite/src/LinearHashTableTest.cpp @@ -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;