From bf8edc374d0c199ae197c4939c059b84c6c8e24f Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 18 Oct 2016 19:50:21 +0100 Subject: Add enable_if to catch some conversion madness --- libdbpp/command.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/libdbpp/command.h b/libdbpp/command.h index ae18158..8fbff4e 100644 --- a/libdbpp/command.h +++ b/libdbpp/command.h @@ -5,6 +5,7 @@ #include #include #include +#include #include "error.h" namespace DB { @@ -64,8 +65,9 @@ namespace DB { #define OPTWRAPPER(func) \ template \ - inline void func(unsigned int i, const O & o) { \ - if (o) \ + inline typename std::enable_if::value>::type func(unsigned int i, const O & o) { \ + bool nn(o); \ + if (nn) \ func(i, *o); \ else \ bindNull(i); \ -- cgit v1.2.3