build fix for pedantic compilers
This commit is contained in:
1 parent
56d236c9f9
commit
13f45991ea
2 files changed
+12
-8
No files matched your search
@@ -45,8 +45,8 @@ struct CommandArgsConsumerSingle
|
||||
|
||||
struct CommandArgsVariantConsumer
|
||||
{
|
||||
template <typename V, typename T1, typename... Ts>
|
||||
static std::enable_if_t<0 < sizeof...(Ts), char const*> TryConsumeTo(V& val, char const* args)
|
||||
template <typename V, typename T1, typename T2, typename... Ts>
|
||||
static char const* TryConsumeTo(V& val, char const* args)
|
||||
{
|
||||
T1 v;
|
||||
if (char const* next = CommandArgsConsumerSingle<T1>::TryConsumeTo(v, args))
|
||||
@@ -55,7 +55,7 @@ struct CommandArgsVariantConsumer
|
||||
return next;
|
||||
}
|
||||
else
|
||||
return TryConsumeTo<V, Ts...>(val, args);
|
||||
return TryConsumeTo<V, T2, Ts...>(val, args);
|
||||
}
|
||||
|
||||
template <typename V, typename T1>
|
||||
|
||||
@@ -52,23 +52,27 @@ struct ExactSequence : public ContainerTag
|
||||
{
|
||||
using value_type = void;
|
||||
|
||||
template <size_t U = sizeof...(chars)>
|
||||
static typename std::enable_if_t<U, char const*> TryConsume(char const* pos)
|
||||
static constexpr bool isSingleChar = !sizeof...(chars);
|
||||
|
||||
template <bool C = isSingleChar>
|
||||
static typename std::enable_if_t<!C, char const*> _TryConsume(char const* pos)
|
||||
{
|
||||
if (*(pos++) == c1)
|
||||
return ExactSequence<chars...>::TryConsume(pos);
|
||||
return ExactSequence<chars...>::_TryConsume(pos);
|
||||
else
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
template <size_t U = sizeof...(chars)>
|
||||
static typename std::enable_if_t<!U, char const*> TryConsume(char const* pos)
|
||||
template <bool C = isSingleChar>
|
||||
static typename std::enable_if_t<C, char const*> _TryConsume(char const* pos)
|
||||
{
|
||||
if (*(pos++) != c1)
|
||||
return nullptr;
|
||||
// if more of string is left, tokenize should return 0 (otherwise we didn't reach end of token yet)
|
||||
return *pos && tokenize(pos) ? nullptr : pos;
|
||||
}
|
||||
|
||||
char const* TryConsume(char const* pos) const { return ExactSequence::_TryConsume(pos); }
|
||||
};
|
||||
|
||||
/************************** VARIANT TAG LOGIC *********************************\
|
||||
|
||||
Reference in new issue
Block a user