Skip to content

Commit

Permalink
core: function_traits noexcept specializations
Browse files Browse the repository at this point in the history
starting from 17th standard noexcept-specification is a part of the
function type. function_traits doesn't have specializations
for noexcept function types thus cannot resolve the traits.
adding noexcept specializations allows function_traits for a larger
class of function types fi noexcept future exception continuations.
seastar supports 20th standard and newer thus there is no need
to worry about compatibility.
  • Loading branch information
Galas' Sergey authored and avikivity committed Feb 5, 2025
1 parent 8ebfc99 commit e817966
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions include/seastar/core/function_traits.hh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,18 @@ template <typename T, typename Ret, typename... Args>
struct function_traits<Ret(T::*)(Args...) const> : public function_traits<Ret(Args...)>
{};

template<typename Ret, typename... Args>
struct function_traits<Ret(*)(Args...) noexcept> : public function_traits<Ret(Args...)>
{};

template <typename T, typename Ret, typename... Args>
struct function_traits<Ret(T::*)(Args...) noexcept> : public function_traits<Ret(Args...)>
{};

template <typename T, typename Ret, typename... Args>
struct function_traits<Ret(T::*)(Args...) const noexcept> : public function_traits<Ret(Args...)>
{};

template <typename T>
struct function_traits : public function_traits<decltype(&T::operator())>
{};
Expand Down

0 comments on commit e817966

Please sign in to comment.