remove user-defined copy constructor

We need to define our own copy constructor only
if an object has pointers or any runtime allocation
of the resource like file handle, a network connection..etc.

note: Default constructor does only shallow copy.
This commit is contained in:
Simon De Backer
2020-06-07 13:33:13 +02:00
committed by Laurent Trinques
parent 9085c6fcda
commit 803414f716
6 changed files with 0 additions and 40 deletions

View File

@@ -27,13 +27,6 @@ int NamesList::MetaTypeId = qRegisterMetaType<NamesList>("NamesList");
NamesList::NamesList() { NamesList::NamesList() {
} }
/**
Constructeur de copie
@param other La NamesList a copier
*/
NamesList::NamesList(const NamesList &other) : hash_names(other.hash_names) {
}
/** /**
Destructeur Destructeur
*/ */

View File

@@ -31,7 +31,6 @@ class NamesList {
// constructors, destructor // constructors, destructor
public: public:
NamesList(); NamesList();
NamesList(const NamesList &);
virtual ~NamesList(); virtual ~NamesList();
// attributes // attributes

View File

@@ -116,26 +116,6 @@ DiagramContent::DiagramContent(Diagram *diagram, bool selected) :
} }
} }
/**
* @brief DiagramContent::DiagramContent
* Copy constructor
* @param other
*/
DiagramContent::DiagramContent(const DiagramContent &other) :
m_elements(other.m_elements),
m_text_fields(other.m_text_fields),
m_images(other.m_images),
m_shapes(other.m_shapes),
m_conductors_to_update(other.m_conductors_to_update),
m_conductors_to_move(other.m_conductors_to_move),
m_other_conductors(other.m_other_conductors),
m_potential_conductors(other.m_potential_conductors),
m_element_texts(other.m_element_texts),
m_texts_groups(other.m_texts_groups),
m_selected_items(other.m_selected_items),
m_tables(other.m_tables)
{}
DiagramContent::~DiagramContent() DiagramContent::~DiagramContent()
{} {}

View File

@@ -47,7 +47,6 @@ class DiagramContent
public: public:
DiagramContent(); DiagramContent();
DiagramContent(Diagram *diagram, bool selected = true); DiagramContent(Diagram *diagram, bool selected = true);
DiagramContent(const DiagramContent &);
~DiagramContent(); ~DiagramContent();
/// Used to filter the different items carried by this container. /// Used to filter the different items carried by this container.

View File

@@ -29,16 +29,6 @@ TitleBlockTemplateCellsSet::TitleBlockTemplateCellsSet(const TitleBlockTemplateV
{ {
} }
/**
Copy constructor
@param copy TitleBlockTemplateCellsSet object to copy
*/
TitleBlockTemplateCellsSet::TitleBlockTemplateCellsSet(const TitleBlockTemplateCellsSet &copy) :
QList<TitleBlockTemplateVisualCell *>(copy),
parent_view_(copy.parent_view_)
{
}
/** /**
Destructor Destructor
*/ */

View File

@@ -29,7 +29,6 @@ class TitleBlockTemplateCellsSet : public QList<TitleBlockTemplateVisualCell *>
// Constructors, destructor // Constructors, destructor
public: public:
TitleBlockTemplateCellsSet(const TitleBlockTemplateView *); TitleBlockTemplateCellsSet(const TitleBlockTemplateView *);
TitleBlockTemplateCellsSet(const TitleBlockTemplateCellsSet &);
virtual ~TitleBlockTemplateCellsSet(); virtual ~TitleBlockTemplateCellsSet();
// methods // methods