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, 12 insertions, 9 deletions
diff --git a/src/database/index.hpp b/src/database/index.hpp
index 094a36a..30766ab 100644
--- a/src/database/index.hpp
+++ b/src/database/index.hpp
@@ -8,16 +8,19 @@
namespace
{
template <std::size_t N=0, typename... T>
-void add_column_name(std::string& out)
+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)
{
- 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);
- }
+ 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);
}
}