diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-06-17 19:51:52 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-06-17 19:51:52 +0100 |
commit | d69dab7433f8215aed78eddcb8244ceda2381ab6 (patch) | |
tree | 800df324eccfba038db956f8e5fd1c0300789fe1 /lib/dbTypes.cpp | |
parent | Mark failing branch of verify unlikely (diff) | |
download | mygrate-d69dab7433f8215aed78eddcb8244ceda2381ab6.tar.bz2 mygrate-d69dab7433f8215aed78eddcb8244ceda2381ab6.tar.xz mygrate-d69dab7433f8215aed78eddcb8244ceda2381ab6.zip |
Add wrapper for writing a DbValueV to a stream
Diffstat (limited to 'lib/dbTypes.cpp')
-rw-r--r-- | lib/dbTypes.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
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<typename T> + 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); + } +} |