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

CTAD for simple_ptr_holder #1701

Merged
merged 3 commits into from
Mar 9, 2022

Conversation

havogt
Copy link
Contributor

@havogt havogt commented Feb 10, 2022

Not sure if it's worth trading aggregate for CTAD. When I looked at make_simple_ptr_holder, I missed that aggregate CTAD is a C++20 feature.

@havogt
Copy link
Contributor Author

havogt commented Feb 10, 2022

launch jenkins

@havogt
Copy link
Contributor Author

havogt commented Feb 10, 2022

launch jenkins

@havogt
Copy link
Contributor Author

havogt commented Feb 10, 2022

launch jenkins

// CTAD for aggregates works
#else
// Enables CTAD in C++17.
simple_ptr_holder() = default;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

default ctor only there for some test cases that rely on default init.

@havogt havogt requested a review from anstaf February 21, 2022 09:52
GT_TARGET GT_FORCE_INLINE constexpr T const &operator()() const { return m_val; }
};

template <class T>
constexpr simple_ptr_holder<T> make_simple_ptr_holder(T const &ptr) {
[[deprecated("use simple_ptr_holder class template argument deduction")]] constexpr simple_ptr_holder<T>
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you sure you want to keep the maker? I thought it is not the part of the public API.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'll keep it for now.

@havogt havogt merged commit 09b9536 into GridTools:master Mar 9, 2022
@havogt havogt deleted the cleanup_make_simple_ptr_holder branch March 9, 2022 08:10
havogt added a commit that referenced this pull request Apr 21, 2022
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