From 6a2c8ec5e0f477220eab912ec04ca25d61a8450c Mon Sep 17 00:00:00 2001 From: eelke Date: Sun, 23 Dec 2018 08:39:38 +0100 Subject: [PATCH] Do not use flat_set anymore gives compilation issues. Not worth the time solving the issue without having prove of a clear benefit of using flat_set over unordered_set. --- pglab/ColumnPage.cpp | 4 ++-- pglab/TablesPage.cpp | 6 +++--- pglab/TriggerPage.cpp | 4 ++-- pglablib/catalog/PgKeywordList.cpp | 9 +++++---- pglablib/catalog/PgKeywordList.h | 1 + 5 files changed, 13 insertions(+), 11 deletions(-) diff --git a/pglab/ColumnPage.cpp b/pglab/ColumnPage.cpp index b8abd20..e17ac22 100644 --- a/pglab/ColumnPage.cpp +++ b/pglab/ColumnPage.cpp @@ -9,7 +9,7 @@ #include "CustomDataRole.h" #include "PgLabItemDelegate.h" #include -#include +#include #include "SqlFormattingUtils.h" ColumnPage::ColumnPage(QWidget *parent) @@ -57,7 +57,7 @@ void ColumnPage::setData(std::shared_ptr cat, const std void ColumnPage::tableView_selectionChanged(const QItemSelection &/*selected*/, const QItemSelection &/*deselected*/) { auto&& indexes = m_tableView->selectionModel()->selectedIndexes(); - boost::container::flat_set rijen; + std::unordered_set rijen; for (const auto &e : indexes) rijen.insert(m_sortFilterProxy->mapToSource(e).row()); diff --git a/pglab/TablesPage.cpp b/pglab/TablesPage.cpp index 5429167..9fe47b7 100644 --- a/pglab/TablesPage.cpp +++ b/pglab/TablesPage.cpp @@ -20,7 +20,7 @@ #include "UserConfiguration.h" #include "SqlCodePreview.h" #include -#include +#include TablesPage::TablesPage(MainWindow *parent) : QWidget(parent) @@ -186,7 +186,7 @@ void TablesPage::selectedTableChanged(const std::optional &table) void TablesPage::constraintsTable_selectionChanged(const QItemSelection &/*selected*/, const QItemSelection &/*deselected*/) { const auto indexes = ui->constraintsTable->selectionModel()->selectedIndexes(); - boost::container::flat_set rijen; + std::unordered_set rijen; for (const auto &e : indexes) rijen.insert(e.row()); @@ -208,7 +208,7 @@ void TablesPage::constraintsTable_modelReset() void TablesPage::indexesTable_selectionChanged(const QItemSelection &/*selected*/, const QItemSelection &/*deselected*/) { const auto indexes = ui->indexesTable->selectionModel()->selectedIndexes(); - boost::container::flat_set rijen; + std::unordered_set rijen; for (const auto &e : indexes) rijen.insert(e.row()); diff --git a/pglab/TriggerPage.cpp b/pglab/TriggerPage.cpp index e58592a..3f10969 100644 --- a/pglab/TriggerPage.cpp +++ b/pglab/TriggerPage.cpp @@ -9,7 +9,7 @@ #include "CustomDataRole.h" #include "PgLabItemDelegate.h" #include -#include +#include TriggerPage::TriggerPage(QWidget *parent) : QSplitter(Qt::Vertical, parent) @@ -55,7 +55,7 @@ void TriggerPage::setFilter(const std::optional &cls) void TriggerPage::tableView_selectionChanged(const QItemSelection &/*selected*/, const QItemSelection &/*deselected*/) { auto&& indexes = m_tableView->selectionModel()->selectedIndexes(); - boost::container::flat_set rijen; + std::unordered_set rijen; for (const auto &e : indexes) rijen.insert(m_sortFilterProxy->mapToSource(e).row()); diff --git a/pglablib/catalog/PgKeywordList.cpp b/pglablib/catalog/PgKeywordList.cpp index 8d38a68..ddbb1fe 100644 --- a/pglablib/catalog/PgKeywordList.cpp +++ b/pglablib/catalog/PgKeywordList.cpp @@ -1,12 +1,13 @@ #include "PgKeywordList.h" -#include +#include namespace { - using KeywordHT = boost::container::flat_set; + using KeywordHT = std::unordered_set; - #define PG_KEYWORD(a,b,c) {a,c}, - const KeywordHT _ScanKeywords = { + #define PG_KEYWORD(a,b,c) Keyword{a,c}, + const KeywordHT _ScanKeywords { + //const Keyword _ScanKeywords[] = { #include }; diff --git a/pglablib/catalog/PgKeywordList.h b/pglablib/catalog/PgKeywordList.h index f3ecd42..11d0c4c 100644 --- a/pglablib/catalog/PgKeywordList.h +++ b/pglablib/catalog/PgKeywordList.h @@ -27,6 +27,7 @@ public: //bool operator<(const QString &s) const { return m_keyword < s; } bool operator<(const Keyword &kw) const { return m_keyword < kw.m_keyword; } + bool operator==(const Keyword &kw) const { return m_keyword == kw.m_keyword; } private: QString m_keyword; int16_t m_category;