Skip to content

Commit

Permalink
These static_asserts require concepts.
Browse files Browse the repository at this point in the history
  • Loading branch information
jtv committed Jan 8, 2025
1 parent 203297f commit a8ce1cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/unit/test_result_iteration.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ void test_result_iteration()
pqxx::connection cx;
pqxx::work tx{cx};
pqxx::result r{tx.exec("SELECT generate_series(1, 3)")};
#if defined(PQXX_HAVE_CONCEPTS)
static_assert(std::forward_iterator<decltype(r.begin())>);
#endif

PQXX_CHECK(std::end(r) != std::begin(r), "Broken begin/end.");
PQXX_CHECK(std::rend(r) != std::rbegin(r), "Broken rbegin/rend.");
Expand Down
2 changes: 2 additions & 0 deletions test/unit/test_row.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@ void test_row()
pqxx::connection cx;
pqxx::work tx{cx};
pqxx::row r{tx.exec("SELECT 1, 2, 3").one_row()};
#if defined(PQXX_HAVE_CONCEPTS)
static_assert(std::forward_iterator<decltype(r.begin())>);
#endif
PQXX_CHECK_EQUAL(std::size(r), 3, "Unexpected row size.");
PQXX_CHECK_EQUAL(r.at(0).as<int>(), 1, "Wrong value at index 0.");
PQXX_CHECK(std::begin(r) != std::end(r), "Broken row iteration.");
Expand Down

0 comments on commit a8ce1cf

Please sign in to comment.