Simplify code using if constexpr:

Also simplify msig construction
This commit is contained in:
seelabs
2019-08-15 11:40:28 -07:00
parent 1eb3753f26
commit c2d2ba9f45
9 changed files with 29 additions and 105 deletions

View File

@@ -83,25 +83,14 @@ stpath_append_one (STPath& st,
boost::none, book.currency, book.account }));
}
inline
void
stpath_append (STPath& st)
{
}
template <class T, class... Args>
void
stpath_append (STPath& st,
T const& t, Args const&... args)
{
stpath_append_one(st, t);
stpath_append(st, args...);
}
inline
void
stpathset_append (STPathSet& st)
{
if constexpr (sizeof...(args) > 0)
stpath_append(st, args...);
}
template <class... Args>
@@ -110,7 +99,8 @@ stpathset_append(STPathSet& st,
STPath const& p, Args const&... args)
{
st.push_back(p);
stpathset_append(st, args...);
if constexpr (sizeof...(args) > 0)
stpathset_append(st, args...);
}
} // detail