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?
Since e566bac, the
BUILDdocument 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_viewin thedinit-util.ccand I think we can completely avoid it by switching to C++17. There are more things like standard constexprstd::pairwhich wasn't available in C++11 and we use things like this to workaround it:dinit/src/includes/load-service.h
Line 353 in 8724882
What do you think? Is it a good idea? And if it is, When to transit to C++17?