0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-16 12:51:13 +08:00

Make result_t::iterator default-constructible.

This commit is contained in:
MeanSquaredError 2024-08-31 23:45:47 +03:00 committed by Roland Bock
parent 5224d6a733
commit 28dac3a3d3

View File

@ -93,6 +93,11 @@ namespace sqlpp
using reference = const result_row_t&; using reference = const result_row_t&;
using difference_type = std::ptrdiff_t; using difference_type = std::ptrdiff_t;
iterator()
: _result_ptr(nullptr), _result_row_ptr(nullptr)
{
}
iterator(db_result_t& result, result_row_t& result_row) iterator(db_result_t& result, result_row_t& result_row)
: _result_ptr(&result), _result_row_ptr(&result_row) : _result_ptr(&result), _result_row_ptr(&result_row)
{ {
@ -110,6 +115,14 @@ namespace sqlpp
bool operator==(const iterator& rhs) const bool operator==(const iterator& rhs) const
{ {
if ((_result_row_ptr != nullptr) != (rhs._result_row_ptr != nullptr))
{
return false;
}
if (_result_row_ptr == nullptr)
{
return true;
}
return *_result_row_ptr == *rhs._result_row_ptr; return *_result_row_ptr == *rhs._result_row_ptr;
} }