From d69dab7433f8215aed78eddcb8244ceda2381ab6 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Thu, 17 Jun 2021 19:51:52 +0100 Subject: Add wrapper for writing a DbValueV to a stream --- lib/dbTypes.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 lib/dbTypes.cpp (limited to 'lib/dbTypes.cpp') diff --git a/lib/dbTypes.cpp b/lib/dbTypes.cpp new file mode 100644 index 0000000..7a428ae --- /dev/null +++ b/lib/dbTypes.cpp @@ -0,0 +1,19 @@ +#include "dbTypes.h" + +namespace std { + struct write { + template + std::ostream & + operator()(const T & v) const + { + return strm << v; + } + std::ostream & strm; + }; + + std::ostream & + operator<<(std::ostream & strm, const MyGrate::DbValueV & v) + { + return std::visit(write {strm}, v); + } +} -- cgit v1.2.3