PointCloudLibrary/pcl

[custom] Remove empty destructors and constructors

开放

#4,283 创建于 2020年7月20日

 (2 条评论) (0 个反应) (0 位负责人)C++ (4,506 个派生)batch import
effort: lowgood first issuekind: todo

仓库指标

星标
 (9,023 个星标)
PR 合并指标
 (平均合并 8天 7小时) (30 天内合并 3 个 PR)

描述

This issue is to split PR #4249 into smaller pieces.

Per @SergioRAgostinho

With destructors I use the following policy:

if your class defines virtual methods which it defines (literally defining, not overriding), I explicitly default it. The compiler throws warnings telling if of your class has virtual methods but the destructor is not virtual.

If a class has empty / default destructors I just remove those lines of code. If the destructor is not implicitly generated you'll get a compiler error, so there's no chance you'll mess up.

For constructors: remove all default constructors unless there's a user defined (non-default) constructor.

From @kunaltyagi: https://godbolt.org/z/8f99dG

贡献者指南