Inspectopedia 2025.2 Help

Common Practices and Code Improvements

'contains' member function can be used   New in this release

'contains' member function can be used.

'if' can be replaced by 'if consteval'   New in this release

'if' can be replaced by 'if consteval'.

'std::erase'/'std::erase_if' can be used instead of the remove-erase idiom   New in this release

'std::erase'/'std::erase_if' can be used instead of the remove-erase idiom.

'std::is_constant_evaluated' will always evaluate to constant   New in this release

'std::is_constant_evaluated' will always evaluate to constant.

Algorithm accepting an iterator and a count can be used   New in this release

Algorithm accepting an iterator and a count can be used.

Algorithm operating on ranges can be used   New in this release

Algorithm operating on ranges can be used.

C-style cast is used instead of a C++ cast   New in this release

C-style cast is used instead of a C++ cast.

Class can be made final   New in this release

Class can be made final.

Compile-time constant expression can be replaced with either 'true' or 'false'   New in this release

Compile-time constant expression can be replaced with either 'true' or 'false'.

consteval if is always constant   New in this release

consteval if is always constant.

Constructor of smart pointer is used instead of its make function   New in this release

Constructor of smart pointer is used instead of its make function.

Declaration and assignment can be joined   New in this release

Declaration and assignment can be joined.

For-loop can be replaced with while-loop   New in this release

For-loop can be replaced with while-loop.

Function returns by const value   New in this release

Function returns by const value.

Functional-style cast is used instead of a C++ cast   New in this release

Functional-style cast is used instead of a C++ cast.

If statement with constant condition can be replaced with 'if constexpr'   New in this release

If statement with constant condition can be replaced with 'if constexpr'.

Lambda can be rewritten to use explicit template parameters   New in this release

Lambda can be rewritten to use explicit template parameters.

Local variable can be made const   New in this release

Local variable can be made const.

Member function can be made const   New in this release

Member function can be made const.

Member function can be made static   New in this release

Member function can be made static.

Namespace definition containing single class specialization   New in this release

Namespace definition containing single class specialization.

Non-explicit conversion operator   New in this release

Non-explicit conversion operator.

Non-explicit converting constructor   New in this release

Non-explicit converting constructor.

Parameter can be made const   New in this release

Parameter can be made const.

Parameter can be made pointer/reference to const   New in this release

Parameter can be made pointer/reference to const.

Pass value parameters by const reference   New in this release

Pass value parameters by const reference.

reinterpret_cast is used instead of static_cast   New in this release

reinterpret_cast is used instead of static_cast.

Result of a postfix operator is discarded   New in this release

Result of a postfix operator is discarded.

std::size can be used   New in this release

std::size can be used.

std::views::keys/values can be used   New in this release

std::views::keys/values can be used.

Structured bindings can be used   New in this release

Structured bindings can be used.

Structured bindings can be used instead of tie(..)   New in this release

Structured bindings can be used instead of tie(..).

Throw expression can be replaced with a rethrow expression   New in this release

Throw expression can be replaced with a rethrow expression.

Type trait can be simplified using a template alias or a variable template   New in this release

Type trait can be simplified using a template alias or a variable template.

Variable can be made constexpr   New in this release

Variable can be made constexpr.

Variable can be moved to init statement   New in this release

Variable can be moved to init statement.

Variable can be moved to inner scope   New in this release

Variable can be moved to inner scope.

Zero constant can be replaced with nullptr   New in this release

Zero constant can be replaced with nullptr.

Zero initialization can be used instead of memset   New in this release

Zero initialization can be used instead of memset.

Last modified: 29 July 2025