Skip to content

Commit

Permalink
fix: resolve omission of constexpr keyword
Browse files Browse the repository at this point in the history
  • Loading branch information
zhihaoy committed May 30, 2022
1 parent 5d82b96 commit 307d1ad
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/std23/function_ref.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ class function_ref<Sig, R(Args...)> : _function_ref_base
: fptr_(
[](storage fn_, _param_t<Args>... args) noexcept(noex) -> R
{
if (std::is_void_v<R>)
if constexpr (std::is_void_v<R>)
get<F>(fn_)(std::forward<Args>(args)...);
else
return get<F>(fn_)(std::forward<Args>(args)...);
Expand All @@ -124,7 +124,7 @@ class function_ref<Sig, R(Args...)> : _function_ref_base
[](storage fn_, _param_t<Args>... args) noexcept(noex) -> R
{
cvref<T> obj = *get<T>(fn_);
if (std::is_void_v<R>)
if constexpr (std::is_void_v<R>)
obj(std::forward<Args>(args)...);
else
return obj(std::forward<Args>(args)...);
Expand Down

0 comments on commit 307d1ad

Please sign in to comment.