Skip to content

Commit

Permalink
Noexcept lambdas
Browse files Browse the repository at this point in the history
  • Loading branch information
morzhovets committed Sep 8, 2024
1 parent 796d410 commit 7779fc9
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions include/momo/Utility.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,8 @@ class FastMovableFunctor

template<typename... Args>
decltype(auto) operator()(Args&&... args) &&
noexcept(noexcept(std::forward<BaseFunctor>(mBaseFunctor)(std::forward<Args>(args)...)))
noexcept(std::is_nothrow_invocable_v<BaseFunctor&&, Args&&...>)
//noexcept(noexcept(std::forward<BaseFunctor>(mBaseFunctor)(std::forward<Args>(args)...))) // gcc 11
{
return std::forward<BaseFunctor>(mBaseFunctor)(std::forward<Args>(args)...);
}
Expand Down Expand Up @@ -391,7 +392,8 @@ class FastCopyableFunctor

template<typename... Args>
decltype(auto) operator()(Args&&... args) const
noexcept(noexcept(mBaseFunctor(std::forward<Args>(args)...)))
noexcept(std::is_nothrow_invocable_v<const BaseFunctor&, Args&&...>)
//noexcept(noexcept(mBaseFunctor(std::forward<Args>(args)...))) // gcc 11
{
return mBaseFunctor(std::forward<Args>(args)...);
}
Expand Down

0 comments on commit 7779fc9

Please sign in to comment.