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 difference_type = std::ptrdiff_t;
iterator()
: _result_ptr(nullptr), _result_row_ptr(nullptr)
{
}
iterator(db_result_t& result, result_row_t& result_row)
: _result_ptr(&result), _result_row_ptr(&result_row)
{
@@ -110,6 +115,14 @@ namespace sqlpp
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;
}