From 062baaecb7fe5601d4de1ffd67a6cef418262ad0 Mon Sep 17 00:00:00 2001 From: Nathaniel Hourt Date: Fri, 3 Sep 2021 19:45:53 -0500 Subject: [PATCH] Fix typestring_is("") case I find that `typestring_is("")` gives back a `typestring<'\0'>` unless I add these overloads to give back a `typestring<>` instead. The `typoke` overload fixes it in the majority of cases, whereas the `typeek` overload is necessary in the `USE_TYPESTRING == 0` case. --- typestring.hh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/typestring.hh b/typestring.hh index 694c2f9..22b773e 100644 --- a/typestring.hh +++ b/typestring.hh @@ -101,6 +101,10 @@ auto typoke(typestring) // as is... template auto typoke(typestring, typestring<'\0'>, typestring...) -> typestring; + +template +auto typoke(typestring<'\0'>, typestring<'\0'>, typestring...) + -> typestring<>; template auto typoke(typestring, typestring, typestring...) @@ -110,6 +114,9 @@ template auto typeek(typestring) -> decltype(typoke(typestring()...)); +auto typeek(typestring<'\0'>) + -> typestring<>; + template auto tycat_(typestring, typestring, X... x) -> decltype(tycat_(typestring(), x...));