我们使用的外部库包含以下显式构造函数:
class Chart {
public:
explicit Chart(Chart::Type type, Object *parent);
// ...
};
Run Code Online (Sandbox Code Playgroud)
编译器抱怨以下警告:
chart.h: warning #2305: declaration of 'explicit' constructor
without a single argument is redundant
Run Code Online (Sandbox Code Playgroud)
是否二进制兼容只是删除explicitchart.h 中的关键字而不重新编译库以避免警告?我的感觉是它很安全,因为explicit在这种情况下无论如何都没有意义.谁能确认一下?