mirror of
https://github.com/ArthurSonzogni/FTXUI.git
synced 2025-09-18 17:18:08 +08:00
Remove explicit default destructors (#157)
From CppCoreGuidelines: Rule of Zero: C.20: If you can avoid defining default operations, do. C.52: Use inheriting constructors to import constructors into a derived class that does not need further explicit initialization. DRY forward and using declarations. Miscellaneous: Fix format.sh to output examples with normalised paths in sorted order. Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
This commit is contained in:

committed by
GitHub

parent
b3a333b417
commit
21d746e858
@@ -14,10 +14,7 @@
|
||||
namespace ftxui {
|
||||
|
||||
namespace {
|
||||
class CaptureMouseImpl : public CapturedMouseInterface {
|
||||
public:
|
||||
~CaptureMouseImpl() override {}
|
||||
};
|
||||
class CaptureMouseImpl : public CapturedMouseInterface {};
|
||||
} // namespace
|
||||
|
||||
ComponentBase::~ComponentBase() {
|
||||
@@ -161,9 +158,9 @@ void ComponentBase::TakeFocus() {
|
||||
/// @param event
|
||||
/// @ingroup component
|
||||
CapturedMouse ComponentBase::CaptureMouse(const Event& event) {
|
||||
if (!event.screen_)
|
||||
return std::make_unique<CaptureMouseImpl>();
|
||||
return event.screen_->CaptureMouse();
|
||||
if (event.screen_)
|
||||
return event.screen_->CaptureMouse();
|
||||
return std::make_unique<CaptureMouseImpl>();
|
||||
}
|
||||
|
||||
} // namespace ftxui
|
||||
|
Reference in New Issue
Block a user