-
Notifications
You must be signed in to change notification settings - Fork 184
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
Port from C++11 to C++17 #2585
Comments
For the first issue about using the filesystem library, what is our intention? For example, do we intend to completely replace the |
Personally, I would want:
|
Can we also get rid of our custom MR::make_unique? |
Yep |
@MRtrix3/mrtrix3-devs: Since there will need to be an explicit rebasing process to generate a |
My opinion here is that a transition to use C++17 features should not require using a predefined set of C++17 features before switching. I don't really see any benefits in this approach. So I would say that building with C++17 has no real downsides, even if you don't use any C++17 feature. |
Only potential downside that comes to mind would be lack of availability of C++17 compiler support for some user attempting to compile from source. I've no idea what the compiler support timelines look like. But if fewer people are compiling from source post production release, perhaps it's safe enough. |
|
Believe the primary relevance was #2297 (QT6)?
But there are other features that we would likely want to change across the code base in the process of transitioning compilation.
Many features can just be made use of whenever a contributor feels like it, but others we might want to adopt across the board.
The goal of this issue is to list & discuss those (so feel free to add to the list).
This may result in reduction or deprecation of
core/file/path.h
and/orcore/file/utils.h
This I'd personally like to see adopted across the code base in order to remove unnecessary indentation.
std::byte
in place of anywhere that auint8_t
is used as a set of bitwise flagsDatatype
comes to mind, but there are likely others.Edit: In addition to bitwise flags, there's also the question of pointers to binary data. On looking around a bit, one suggestion seems to be to use
std::byte*
for pointers to completely unstructured / untyped binary data, whereas if the implication is that the underlying data will have some type but the handling code is type-agnostic, continue to usevoid*
. But we could equally usestd::byte*
for any type-agnostic pointers to binary memory. Open to thoughts.Edit: C++17 also has
std::string_view
; this should perhaps be used in instances of interfacing with some code dependency that uses C-style strings, but I'd advocate removing C-style strings across the board where we have the control to do so.MR::vector<>
, revert tostd::vector<>
make_shared<>()
andmake_unique<>()
The text was updated successfully, but these errors were encountered: