summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libdbpp/command.h6
1 files 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 <boost/date_time/posix_time/posix_time_types.hpp>
#include <boost/shared_ptr.hpp>
#include <visibility.h>
+#include <type_traits>
#include "error.h"
namespace DB {
@@ -64,8 +65,9 @@ namespace DB {
#define OPTWRAPPER(func) \
template<typename O> \
- inline void func(unsigned int i, const O & o) { \
- if (o) \
+ inline typename std::enable_if<std::is_constructible<bool, const O &>::value>::type func(unsigned int i, const O & o) { \
+ bool nn(o); \
+ if (nn) \
func(i, *o); \
else \
bindNull(i); \