From 8e69c9c459600901b998faee80edf654819e2b5b Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 8 Aug 2021 14:16:31 +0100 Subject: Simplify some bits with concepts --- lib/output/pq/pqBindings.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'lib/output') 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 +#include #include #include #include @@ -21,23 +22,20 @@ namespace MyGrate::Output::Pq { v.visit(*this); } } - template void - operator()(const T & v) + operator()(const Stringable auto & v) { addBuf(std::to_string(v)); } - template 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 void - operator()(const T & v) + operator()(const auto & v) { addBuf(scprintf<"%?">(v)); } -- cgit v1.2.3