libpqxx
The C++ client library for PostgreSQL
result-connection.hxx
Go to the documentation of this file.
1 #ifndef PQXX_INTERNAL_GATES_RESULT_CONNECTION_HXX
2 #define PQXX_INTERNAL_GATES_RESULT_CONNECTION_HXX
3 
5 
6 namespace pqxx::internal::gate
7 {
8 class PQXX_PRIVATE result_connection final : callgate<result const>
9 {
10  friend class pqxx::connection;
11 
12  explicit constexpr result_connection(reference x) noexcept : super(x) {}
13 
14  [[nodiscard]] explicit operator bool() const noexcept
15  {
16  return bool(home());
17  }
18  [[nodiscard]] bool operator!() const noexcept { return not home(); }
19 };
20 } // namespace pqxx::internal::gate
21 #endif
Connection to a database.
Definition: connection.hxx:273
Base class for call gates.
Definition: callgate.hxx:55
result const & reference
A reference to the host class. Helps keep constructors easy.
Definition: callgate.hxx:60
Definition: result-connection.hxx:9
#define PQXX_PRIVATE
Definition: header-pre.hxx:207
Definition: connection.hxx:94