summaryrefslogtreecommitdiff
path: root/src/database/index.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/database/index.hpp')
-rw-r--r--src/database/index.hpp21
1 files changed, 9 insertions, 12 deletions
diff --git a/src/database/index.hpp b/src/database/index.hpp
index 30766ab..094a36a 100644
--- a/src/database/index.hpp
+++ b/src/database/index.hpp
@@ -8,19 +8,16 @@
namespace
{
template <std::size_t N=0, typename... T>
-typename std::enable_if<N == sizeof...(T), void>::type
-add_column_name(std::string&)
-{ }
-
-template <std::size_t N=0, typename... T>
-typename std::enable_if<N < sizeof...(T), void>::type
-add_column_name(std::string& out)
+void add_column_name(std::string& out)
{
- using ColumnType = typename std::remove_reference<decltype(std::get<N>(std::declval<std::tuple<T...>>()))>::type;
- out += ColumnType::name;
- if (N != sizeof...(T) - 1)
- out += ",";
- add_column_name<N+1, T...>(out);
+ if constexpr(N < sizeof...(T))
+ {
+ using ColumnType = typename std::remove_reference<decltype(std::get<N>(std::declval<std::tuple<T...>>()))>::type;
+ out += ColumnType::name;
+ if (N != sizeof...(T) - 1)
+ out += ",";
+ add_column_name<N + 1, T...>(out);
+ }
}
}