diff --git a/ostd/format.hh b/ostd/format.hh index 02968af..6c058f3 100644 --- a/ostd/format.hh +++ b/ostd/format.hh @@ -27,7 +27,7 @@ enum FormatFlags { FMT_FLAG_HASH = 1 << 4 }; -struct format_error: public std::runtime_error { +struct format_error: std::runtime_error { using std::runtime_error::runtime_error; }; diff --git a/ostd/range.hh b/ostd/range.hh index 6f90ed4..2f2f559 100644 --- a/ostd/range.hh +++ b/ostd/range.hh @@ -698,8 +698,10 @@ struct InputRange { } }; -template>> -inline auto operator|(R &&range, F &&func) { +template +inline auto operator|(R &&range, F &&func) -> + std::enable_if_t, decltype(func(std::forward(range)))> +{ return func(std::forward(range)); }