Skip to content

Instantly share code, notes, and snippets.

@CapSel
Created October 28, 2017 11:28
Show Gist options
  • Save CapSel/e04479d760f948775b4603d33bde66e4 to your computer and use it in GitHub Desktop.
Save CapSel/e04479d760f948775b4603d33bde66e4 to your computer and use it in GitHub Desktop.
diff --git a/math.cpp b/math.cpp
index 1805323..e919dea 100644
--- a/math.cpp
+++ b/math.cpp
@@ -47,7 +47,7 @@ struct Expression {
fact.value = value;
}
template <typename Stack, typename... T> constexpr void action(Stack & stack, T && ... args) {
- Fallback fb;
+ Fallback fb {};
found(stack.template nearest<Fact>(fb), stack, std::forward<T>(args)...);
}
};
diff --git a/regexp.cpp b/regexp.cpp
index d4aeb70..29ced7e 100644
--- a/regexp.cpp
+++ b/regexp.cpp
@@ -108,15 +108,15 @@ template<typename CharT, CharT ... string> constexpr auto operator""_re() {
using Parser = Decider<Stack<S>, Input<string...>>;
static_assert(Parser::correct);
- return typename Parser::template Type<RegExp<>>{};
+ return typename Parser::template Type<struct RegExp<>>{};
}
int main() {
using namespace RegExp;
- static_assert( std::is_same<decltype("x$"_re), RegExp<Char<'x'>,End>> ::value);
- static_assert( std::is_same<decltype("^x$"_re), RegExp<Begin,Char<'x'>,End>> ::value);
- static_assert( std::is_same<decltype("^xy$"_re), RegExp<Begin,Char<'x'>,Char<'y'>,End>> ::value);
- static_assert( std::is_same<decltype("^."_re), RegExp<Begin,Anything>> ::value);
+ static_assert( std::is_same<decltype("x$"_re), struct RegExp<Char<'x'>,End>> ::value);
+ static_assert( std::is_same<decltype("^x$"_re), struct RegExp<Begin,Char<'x'>,End>> ::value);
+ static_assert( std::is_same<decltype("^xy$"_re), struct RegExp<Begin,Char<'x'>,Char<'y'>,End>> ::value);
+ static_assert( std::is_same<decltype("^."_re), struct RegExp<Begin,Anything>> ::value);
static_assert("^x$"_re.match("x") == true);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment