summaryrefslogtreecommitdiff
path: root/libpqpp/pq-binarycolumn.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-10-08 18:59:35 +0100
committerDan Goodliffe <dan@randomdan.homeip.net>2023-10-08 18:59:35 +0100
commitfa16a96443f4b3a7b62ca05338e88d0ce13a849f (patch)
tree3e0a682889caed767990861c4b320a91b83849e8 /libpqpp/pq-binarycolumn.h
parentMove to C++23 (for std::byteswap) (diff)
downloadlibdbpp-postgresql-fa16a96443f4b3a7b62ca05338e88d0ce13a849f.tar.bz2
libdbpp-postgresql-fa16a96443f4b3a7b62ca05338e88d0ce13a849f.tar.xz
libdbpp-postgresql-fa16a96443f4b3a7b62ca05338e88d0ce13a849f.zip
Move valueAs to BinaryColumn, implement with std::byteswap
Removes the need to cast to/from BSD endian supported types.
Diffstat (limited to 'libpqpp/pq-binarycolumn.h')
-rw-r--r--libpqpp/pq-binarycolumn.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/libpqpp/pq-binarycolumn.h b/libpqpp/pq-binarycolumn.h
index e2a8044..e44d7e2 100644
--- a/libpqpp/pq-binarycolumn.h
+++ b/libpqpp/pq-binarycolumn.h
@@ -15,6 +15,9 @@ namespace PQ {
BinaryColumn(const SelectBase *, unsigned int field);
void apply(DB::HandleField &) const override;
+
+ private:
+ template<std::integral T> [[nodiscard]] inline T valueAs() const;
};
}