PointCloudLibrary/pcl

[custom] Remove empty destructors and constructors

オープン

#4,283 opened on 2020/07/20

 (2 件のコメント) (0 件のリアクション) (0 人の担当者)C++ (4,506 件のフォーク)batch import
effort: lowgood first issuekind: todo

Repository metrics

Stars
 (9,023 個のスター)
PR merge metrics
 (平均マージ 8d 7h) (30d で 3 merged PRs)

説明

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

コントリビューターガイド