From 6a6b55518847de8d8de8b963a117c53f0c93f67f Mon Sep 17 00:00:00 2001
From: znone <glyc@sina.com.cn>
Date: Tue, 05 Oct 2021 00:50:40 +0000
Subject: [PATCH] Query_iterator remove std::iterator. MySQL: Fix some error. PostgreSQL: Support binding to std::any and std::optional.
---
include/qtl_common.hpp | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/include/qtl_common.hpp b/include/qtl_common.hpp
index c6300c6..2e10108 100644
--- a/include/qtl_common.hpp
+++ b/include/qtl_common.hpp
@@ -768,9 +768,15 @@
}
template<typename Command, typename Record>
-class query_iterator final : public std::iterator<std::forward_iterator_tag, Record>
+class query_iterator final
{
public:
+ using iterator_category = std::forward_iterator_tag;
+ using value_type = Record;
+ using difference_type = ptrdiff_t;
+ using pointer = Record*;
+ using reference = Record&;
+
explicit query_iterator(Command& command)
: m_command(command) { }
Record* operator->() const { return m_record.get(); }
@@ -780,7 +786,7 @@
{
if(!m_record)
m_record=std::make_shared<Record>();
- if(m_record.unique())
+ if(m_record.use_count()==1)
{
if(!m_command.fetch(std::forward<Record>(*m_record)))
m_record.reset();
--
Gitblit v1.9.3