Skip to content

Commit

Permalink
Merge pull request arximboldi#154 from arximboldi/fix-clang-gcc-issue
Browse files Browse the repository at this point in the history
Fix combining modern Clang with libstdc++
  • Loading branch information
arximboldi authored Jul 11, 2022
2 parents 6294fae + c8dbea3 commit b6f4070
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
16 changes: 14 additions & 2 deletions lager/effect.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,26 @@ lager::effect<lager::actions<...>, ...> " //

template <
typename Fn,
std::enable_if_t<std::is_same_v<void, std::invoke_result_t<Fn&, const context_t&>>,
int> = 0>
std::enable_if_t<
std::is_same_v<void, std::invoke_result_t<Fn&, const context_t&>>,
int> = 0>
effect(Fn&& fn)
: base_t{[fn = std::forward<Fn>(fn)](auto&& ctx) -> future {
fn(ctx);
return {};
}}
{}

template <
typename Fn,
std::enable_if_t<
!std::is_convertible_v<std::decay_t<Fn>, effect> &&
std::is_same_v<future,
std::invoke_result_t<Fn&, const context_t&>>,
int> = 0>
effect(Fn&& fn)
: base_t{std::forward<Fn>(fn)}
{}
};

/*!
Expand Down
4 changes: 2 additions & 2 deletions shell.nix
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
compiler ? "",
rev ? "e1118817a12dba39081d9e70ae52dd38aa184c2e",
sha256 ? "04jhgyr5ibdhjay3s5jx11q5y9mfn8nd8lr941b0jlpky89a1pjw",
rev ? "f904e3562aabca382d12f8471ca2330b3f82899a",
sha256 ? "1lsa3sjwp1v3nv2jjpkl5lf9dncplwihmavasalg9fq1217pmzmb",
nixpkgs ? builtins.fetchTarball {
name = "nixpkgs-${rev}";
url = "https://github.com/nixos/nixpkgs/archive/${rev}.tar.gz";
Expand Down

0 comments on commit b6f4070

Please sign in to comment.