libprimis icon indicating copy to clipboard operation
libprimis copied to clipboard

Use `inline` variable constants instead of `extern const`

Open no-lex opened this issue 4 years ago • 0 comments

As of C++17, it is possible to inline variables in headers, which means they can be defined in headers without being created individually for each compilation unit. This means that the handful of variables declared extern const can be moved to headers and defined inline without any meaningful change in the binary code (and an increase in clarity).

Since extern const is one of the few (formerly) acceptable ways to have extern in a regular code file, moving these cases to inline will make it easier to spot remaining extern declarations which are not supposed to be there (#113).

no-lex avatar Jan 05 '21 05:01 no-lex