fixed session tests
This commit is contained in:
@@ -40,8 +40,7 @@ public:
|
||||
, result_(x.result_)
|
||||
{}
|
||||
|
||||
query_result_iterator& operator=(query_result_iterator&& x) noexcept
|
||||
{
|
||||
query_result_iterator& operator=(query_result_iterator&& x) noexcept {
|
||||
result_ = x.result_;
|
||||
obj_ = std::move(x.obj_);
|
||||
return *this;
|
||||
@@ -49,18 +48,15 @@ public:
|
||||
|
||||
~query_result_iterator() = default;
|
||||
|
||||
bool operator==(const query_result_iterator& rhs)
|
||||
{
|
||||
bool operator==(const query_result_iterator& rhs) {
|
||||
return obj_ == rhs.obj_;
|
||||
}
|
||||
|
||||
bool operator!=(const query_result_iterator& rhs)
|
||||
{
|
||||
bool operator!=(const query_result_iterator& rhs) {
|
||||
return obj_ != rhs.obj_;
|
||||
}
|
||||
|
||||
self& operator++()
|
||||
{
|
||||
self& operator++() {
|
||||
obj_.reset(result_->create());
|
||||
result_->bind(*obj_);
|
||||
if (!result_->fetch(*obj_)) {
|
||||
@@ -70,8 +66,7 @@ public:
|
||||
return *this;
|
||||
}
|
||||
|
||||
self operator++(int)
|
||||
{
|
||||
self operator++(int) {
|
||||
const self tmp(result_, obj_);
|
||||
|
||||
obj_.reset(result_->create());
|
||||
@@ -83,23 +78,19 @@ public:
|
||||
return tmp;
|
||||
}
|
||||
|
||||
pointer operator->()
|
||||
{
|
||||
pointer operator->() {
|
||||
return obj_.get();
|
||||
}
|
||||
|
||||
reference operator*()
|
||||
{
|
||||
reference operator*() {
|
||||
return *obj_;
|
||||
}
|
||||
|
||||
pointer get()
|
||||
{
|
||||
pointer get() {
|
||||
return obj_.get();
|
||||
}
|
||||
|
||||
pointer release()
|
||||
{
|
||||
pointer release() {
|
||||
return obj_.release();
|
||||
}
|
||||
|
||||
@@ -111,8 +102,7 @@ private:
|
||||
namespace detail {
|
||||
|
||||
template < typename Type >
|
||||
Type* create_prototype(const std::vector<object::attribute_definition> &/*prototype*/)
|
||||
{
|
||||
Type* create_prototype(const std::vector<object::attribute_definition> &/*prototype*/) {
|
||||
return new Type{};
|
||||
}
|
||||
|
||||
@@ -128,11 +118,11 @@ public:
|
||||
using creator_func = std::function<Type*()>;
|
||||
|
||||
public:
|
||||
explicit query_result(std::unique_ptr<query_result_impl> &&impl)
|
||||
: impl_(std::move(impl))
|
||||
, creator_([this] {
|
||||
return detail::create_prototype<Type>(impl_->prototype());
|
||||
}) {}
|
||||
// explicit query_result(std::unique_ptr<query_result_impl> &&impl)
|
||||
// : impl_(std::move(impl))
|
||||
// , creator_([this] {
|
||||
// return detail::create_prototype<Type>(impl_->prototype());
|
||||
// }) {}
|
||||
|
||||
query_result(std::unique_ptr<query_result_impl> &&impl, creator_func&& creator)
|
||||
: impl_(std::move(impl))
|
||||
|
||||
Reference in New Issue
Block a user