Skip to content

Commit

Permalink
Add a copy constructor in Cell_attribute.
Browse files Browse the repository at this point in the history
This solves a bug in one of my prog, which occurs only for CMap with index.
I don't understand why the default copy constructor is not enough for
CMap with index (while it works for CMap with handle).
  • Loading branch information
gdamiand committed Mar 9, 2023
1 parent 6e90160 commit 0189b6b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Combinatorial_map/include/CGAL/Cell_attribute.h
Original file line number Diff line number Diff line change
Expand Up @@ -397,6 +397,11 @@ struct Init_id;
typedef OnSplit On_split;
typedef void Info;

// Copy constructor why this is required for CMap with index and not for CMap with handle ?
Cell_attribute(const Cell_attribute& other) :
Cell_attribute_without_info<Refs, Tag_, OnMerge, OnSplit, WithID>(other)
{}

protected:
/// Default constructor.
Cell_attribute()
Expand Down Expand Up @@ -460,6 +465,12 @@ struct Init_id;
bool operator!=(const Self& other) const
{ return !operator==(other); }

// Copy constructor why this is required for CMap with index and not cor CMap with handle ?
Cell_attribute(const Self& other) :
Cell_attribute_without_info<Refs, Tag_, OnMerge, OnSplit, WithID>(other),
Info_for_cell_attribute<Info_>(other)
{}

protected:
/// Default constructor.
Cell_attribute()
Expand Down

0 comments on commit 0189b6b

Please sign in to comment.