diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-08-08 14:16:31 +0100 |
---|---|---|
committer | Dan Goodliffe <dan@randomdan.homeip.net> | 2021-08-08 16:15:07 +0100 |
commit | 8e69c9c459600901b998faee80edf654819e2b5b (patch) | |
tree | aee97c616eb6b0c760d9edf01919db1437082b50 /lib/output | |
parent | Extract WritePqCopyStrm into its own file (diff) | |
download | mygrate-8e69c9c459600901b998faee80edf654819e2b5b.tar.bz2 mygrate-8e69c9c459600901b998faee80edf654819e2b5b.tar.xz mygrate-8e69c9c459600901b998faee80edf654819e2b5b.zip |
Simplify some bits with concepts
Diffstat (limited to 'lib/output')
-rw-r--r-- | lib/output/pq/pqBindings.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/output/pq/pqBindings.h b/lib/output/pq/pqBindings.h index 2a4ac8c..329a2cf 100644 --- a/lib/output/pq/pqBindings.h +++ b/lib/output/pq/pqBindings.h @@ -2,6 +2,7 @@ #define MYGRATE_OUTPUT_PQ_PQBINDINGS #include <compileTimeFormatter.h> +#include <concepts> #include <dbTypes.h> #include <helpers.h> #include <initializer_list> @@ -21,23 +22,20 @@ namespace MyGrate::Output::Pq { v.visit(*this); } } - template<Stringable T> void - operator()(const T & v) + operator()(const Stringable auto & v) { addBuf(std::to_string(v)); } - template<Viewable T> void - operator()(const T & v) + operator()(const Viewable auto & v) { values.emplace_back(v.data()); lengths.emplace_back(v.size()); formats.push_back(1); } - template<typename T> void - operator()(const T & v) + operator()(const auto & v) { addBuf(scprintf<"%?">(v)); } |