webview icon indicating copy to clipboard operation
webview copied to clipboard

C++ Core Guidelines: Prefer the {}-initializer syntax

Open SteffenL opened this issue 7 months ago • 0 comments
trafficstars

Investigate library's conformance with C++ Core Guidelines "Prefer the {}-initializer syntax" rule and apply fixes.

The library is currently using a mix of (), {} and = so it makes a lot of sense to fix this inconsistency, and to prefer C++ Core Guidelines recommendations.

As of Clang Tidy 19, there aren't any Clang Tidy rules for this.

Specific things to look into:

  • Base class initialization
  • Member variables
  • Local variables

Regex pattern for finding variables initialized with =:

([*&]|[A-Za-z0-9_]+(?<!using)) +[A-Za-z0-9_]+ +=[\n ]

SteffenL avatar Mar 31 '25 07:03 SteffenL