Skip to content

Utilize features from C++17 #549

@mobin-2008

Description

@mobin-2008

Since e566bac, the BUILD document suggests GCC 11 and Clang 7 or later compilers for compiling Dinit. I searched the internet and found out that both (GCC: 1 and Clang: 2) compilers seems to support C++17 and even some bits from C++20 (which was the "c++2a" draft at that moment).

I think we can cleanup the code base a little bit if we use C++17 by default. For example I encountered the implementation of string_view in the dinit-util.cc and I think we can completely avoid it by switching to C++17. There are more things like standard constexpr std::pair which wasn't available in C++11 and we use things like this to workaround it:

// Signal name and number (the std::pair constructor isn't constexpr in C++11, so we use a custom type).

What do you think? Is it a good idea? And if it is, When to transit to C++17?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions