Commit 1cbfe4e4 authored by Ronan's avatar Ronan

fix(MainDb): SqlEventFilterBuilder => better code

parent fc3ac05c
......@@ -120,7 +120,7 @@ namespace Private {
raw{ char('0' + Value / pow10(N - Index - 2) % 10)..., '\0' } {}
template<std::size_t... Index, typename Int = int, typename std::enable_if<IsNeg::value, Int>::type* = nullptr>
constexpr StaticIntStringHelper(const IndexSequence<Index...> &) :
constexpr StaticIntStringHelper (const IndexSequence<Index...> &) :
raw{ '-', char('0' + abs(Value) / pow10(N - Index - 3) % 10)..., '\0' } {}
};
};
......
......@@ -138,16 +138,14 @@ struct SqlEventFilterBuilder {};
template<EventLog::Type Type, EventLog::Type... List>
struct SqlEventFilterBuilder<Type, List...> {
static constexpr Private::StaticString<1 + getIntLength(int(Type)) + sums((1 + getIntLength(int(List)))...)> get () {
return StaticIntString<int(Type)>() + "," + SqlEventFilterBuilder<List...>::get();
}
static constexpr auto get () L_AUTO_RETURN(
StaticIntString<int(Type)>() + "," + SqlEventFilterBuilder<List...>::get()
);
};
template<EventLog::Type Type>
struct SqlEventFilterBuilder<Type> {
static constexpr Private::StaticString<1 + getIntLength(int(Type))> get () {
return StaticIntString<int(Type)>();
}
static constexpr auto get () L_AUTO_RETURN(StaticIntString<int(Type)>());
};
// -----------------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment