From 9bfa2416274ef9df67bce920f9d66fcf85d70b05 Mon Sep 17 00:00:00 2001
From: Nick Fistere <nwfistere@gmail.com>
Date: Tue, 16 May 2023 11:33:41 -0500
Subject: [PATCH] Delete copy constructor and copy operator (#638)

Co-authored-by: ArthurSonzogni <sonzogniarthur@gmail.com>
---
 CHANGELOG.md                               | 1 +
 include/ftxui/component/component_base.hpp | 6 ++++++
 2 files changed, 7 insertions(+)

diff --git a/CHANGELOG.md b/CHANGELOG.md
index 2d5cffb4..73c6a3d5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -10,6 +10,7 @@ current (development)
 - Feature: Support `ResizableSplit` with customizable separator.
 - Breaking: MenuDirection enum is renamed Direction
 - Fix: Remove useless new line when using an alternative screen.
+- Breaking/Fix: Remove `ComponentBase` copy constructor/assignment.
 
 ### Dom
 - Feature: Add the dashed style for border and separator.
diff --git a/include/ftxui/component/component_base.hpp b/include/ftxui/component/component_base.hpp
index d63c7ed2..25a2b870 100644
--- a/include/ftxui/component/component_base.hpp
+++ b/include/ftxui/component/component_base.hpp
@@ -29,6 +29,12 @@ class ComponentBase {
   // virtual Destructor.
   virtual ~ComponentBase();
 
+  ComponentBase() = default;
+
+  // A component is not copiable.
+  ComponentBase(const ComponentBase&) = delete;
+  void operator=(const ComponentBase&) = delete;
+
   // Component hierarchy:
   ComponentBase* Parent() const;
   Component& ChildAt(size_t i);
-- 
GitLab