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

Update to C++14. #907

Closed
1uc opened this issue Dec 22, 2023 · 6 comments
Closed

Update to C++14. #907

1uc opened this issue Dec 22, 2023 · 6 comments
Labels
v3 Anything that needs to be resolved before `v3`.

Comments

@1uc
Copy link
Collaborator

1uc commented Dec 22, 2023

For 3.0.0 should C++14 be the new minimum supported version? Please list features you'd like to use, or explain why this would be disruptive.

@1uc 1uc added the v3 Anything that needs to be resolved before `v3`. label Dec 22, 2023
@1uc
Copy link
Collaborator Author

1uc commented Dec 22, 2023

It feels like C++14 is very widely supported now. (Needs to be checked.) Therefore, it may make sense. On the other hand I'm not convinced that HighFive gains much. The one convincing argument I've heard is std::enable_if_t. Personally, I feel that doesn't improve anything for users, and of devs its a cosmetic change.

@alkino
Copy link
Member

alkino commented Dec 22, 2023

I would prefer C++17 to have if constexpr and some other features.

@1uc
Copy link
Collaborator Author

1uc commented Dec 22, 2023

Yes, C++17 would add features we could use.

Unfortunately,
https://github.com/BlueBrain/libsonata/blob/0577eb5142e65363087facb9dc6c12dfd2ae49f2/CMakeLists.txt#L58
https://github.com/BlueBrain/MorphIO/blob/6038b3be8ad277a2b4c4ebb441b48d8262ee031a/CMakeLists.txt#L39

so I don't think we're able to make this change. Moreover, I'm not convinced C++17 is sufficiently mainstream yet; and C++23 would allow us to write a completely different library: std::mdspan, concepts, modules, structured binding, etc. Therefore, I'm leaning towards leaving HighFive at C++14 and let someone build H5++23 for C++23 onwards.

@VictorEijkhout
Copy link

I was just going to remark that you have examples with vector of vectors and that mdspan is decidedly more modern, certainly for the sort of users that would use hdf5.

@1uc
Copy link
Collaborator Author

1uc commented Jan 30, 2024

C++14 added [deprecated] which is portable and can be used for using statements. This allows the following:

namespace deprecated {
class Old{
 // ...
};
}

using Old [deprecated("soon gone")] = deprecated::Old;

foo(const deprecated::Old& old);

Directly deprecating Old has the effect that HighFive itself will using the deprecated feature and generate warnings because of this.

@1uc
Copy link
Collaborator Author

1uc commented Feb 12, 2024

We might use unique_ptr in the future. Hence, C++14 seems sensible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
v3 Anything that needs to be resolved before `v3`.
Projects
None yet
Development

No branches or pull requests

3 participants