Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

core: function_traits noexcept specializations #2633

Merged
merged 1 commit into from
Feb 5, 2025

Conversation

Comrade88
Copy link

@Comrade88 Comrade88 commented Feb 3, 2025

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.

@@ -57,6 +57,21 @@ template <typename T, typename Ret, typename... Args>
struct function_traits<Ret(T::*)(Args...) const> : public function_traits<Ret(Args...)>
{};

#if __cplusplus >= 201703L
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can drop this #ifdef, Seastar support C++20 and C++23 only.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Copy link
Author

@Comrade88 Comrade88 Feb 5, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@avikivity , is there anything else that needs improvement?

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.
@Comrade88 Comrade88 changed the title core: function_traits standard conditional noexcept specializations core: function_traits noexcept specializations Feb 4, 2025
@avikivity avikivity merged commit e817966 into scylladb:master Feb 5, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants