Last batch of rules to write C++17 compliant code

Hello C++ developers,

This is our third post related to the C++17 standard and rules to take the best of it.

This time, we added 6 new rules:

  • S6025: Use “std::variant” instead of unions with non-trivial types
  • S5995: “bind” should not be used
  • S6021: Heterogeneous sorted containers should only be used with types that support heterogeneous comparison
  • S6008: Fold expressions should be used instead of recursive template instantiations
  • S6012: Redundant class template arguments should not be used
  • S6024: Free functions should be preferred to member functions when accessing a container in a generic context

In total, it’s 31 rules that will help you write C++17 compliant code. From there, we will take a break and see what we can do for C++20 standard.

This is available on SonarCloud.io and SonarQube Developer Edition 8.7+.

Alex

1 Like

Hi @Alexandre_Gigleux

in the announcement of SonarQube 8.7 the heading “Write better C++17 code” is marked EE, DCE. Can you please explain, which C++ imporvements are missing in Developer Edition? Thanks.

Hi Volker,

SonarSource Marketing here - in the excitement over announcing SonarQube v8.7 we (me actually :grinning:) called out for the wrong set of Commercial Edition badges! The C++ features called out in the announcement come starting with Developer Edition.

Apologies for the confusion! The corrections should get pushed to production in a day or two.

Happy, clean coding! :sunglasses:

1 Like

Thanks @Clint.Cameron for the correction.

I was sadly disappointed when I read the initial announcement as this was the 2nd point I’m interessted in which was only marked for EE (the other is monorepo support).

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.