Add postgresql support

This commit is contained in:
louiz’
2017-12-02 20:08:47 +01:00
parent 5b27cee972
commit 0168b96b79
32 changed files with 1008 additions and 342 deletions
+17
View File
@@ -0,0 +1,17 @@
#pragma once
#include <type_traits>
template <typename...>
struct is_one_of_implem {
static constexpr bool value = false;
};
template <typename F, typename S, typename... T>
struct is_one_of_implem<F, S, T...> {
static constexpr bool value =
std::is_same<F, S>::value || is_one_of_implem<F, T...>::value;
};
template<typename... T>
constexpr bool is_one_of = is_one_of_implem<T...>::value;
+8
View File
@@ -0,0 +1,8 @@
#include <utils/optional_bool.hpp>
std::ostream& operator<<(std::ostream& os, const OptionalBool& o)
{
os << o.to_string();
return os;
}
+3 -1
View File
@@ -20,7 +20,7 @@ struct OptionalBool
this->is_set = false;
}
std::string to_string()
std::string to_string() const
{
if (this->is_set == false)
return "unset";
@@ -33,3 +33,5 @@ struct OptionalBool
bool is_set{false};
bool value{false};
};
std::ostream& operator<<(std::ostream& os, const OptionalBool& o);