Skip to content

Commit

Permalink
Fix using std::monostate seems broken
Browse files Browse the repository at this point in the history
  • Loading branch information
arximboldi committed Aug 17, 2022
1 parent 5da3b90 commit 279ff67
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/ewig/application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ struct arg<void>
template <typename Fn, typename Arg, typename... Args>
static auto invoke(Fn&& fn, const Arg& arg, Args&&... args)
{
assert(std::holds_alternative<std::monostate>(arg));
assert(std::holds_alternative<none_t>(arg));
return std::forward<Fn>(fn)(std::forward<Args>(args)...);
}
};
Expand Down
5 changes: 4 additions & 1 deletion src/ewig/application.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@

namespace ewig {

using arg_t = std::variant<std::monostate,
struct none_t {};

using arg_t = std::variant<none_t,
std::string,
wchar_t>;

Expand Down Expand Up @@ -81,6 +83,7 @@ application apply_edit(application state, coord size, std::pair<buffer, text> ed

} // namespace ewig

LAGER_STRUCT(ewig, none_t);
LAGER_STRUCT(ewig, key_action, key);
LAGER_STRUCT(ewig, resize_action, size);
LAGER_STRUCT(ewig, command_action, name, arg);
Expand Down

0 comments on commit 279ff67

Please sign in to comment.