1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-04 18:06:22 +03:00

0025324: Make OCCT collections copy-constructible

Since TCollection package is going to be obsolete we change only classes that are currently needed to have copy constructor.
This commit is contained in:
msv 2014-10-06 11:45:28 +04:00 committed by bugmaster
parent 61aa7f3d3c
commit 39ef94f8f5
3 changed files with 17 additions and 9 deletions

View File

@ -37,6 +37,12 @@ class TColStd_PackedMapOfInteger : private TCollection_BasicMap
: TCollection_BasicMap (NbBuckets, Standard_True),
myExtent (0) {}
/// Copy constructor
inline TColStd_PackedMapOfInteger (const TColStd_PackedMapOfInteger& theOther)
: TCollection_BasicMap (1, Standard_True),
myExtent (0)
{ Assign(theOther); }
inline TColStd_PackedMapOfInteger&
operator = (const TColStd_PackedMapOfInteger& Other)
{ return Assign(Other); }
@ -210,11 +216,6 @@ public:
private:
// ----------- PRIVATE (PROHIBITED) methods
/// Copy constructor - prohibited.
TColStd_PackedMapOfInteger (const TColStd_PackedMapOfInteger& theOther);
// ---------- PRIVATE FIELDS ----------
size_t myExtent;

View File

@ -70,11 +70,8 @@ is
-- assignment operator (operator=).
---C++: inline
Create(Other : Sequence) returns Sequence from TCollection
Create(Other : Sequence) returns Sequence from TCollection;
---Purpose: Creation by copy of existing Sequence.
-- Warning: This constructor prints a warning message.
-- We recommand to use the operator =.
is private;
Clear(me : in out);
---Purpose: Removes all element(s) of the sequence <me>

View File

@ -23,6 +23,16 @@ inline TCollection_Sequence::TCollection_Sequence()
{
}
//=======================================================================
//function : Copy constructor
//purpose :
//=======================================================================
inline TCollection_Sequence::TCollection_Sequence(const TCollection_Sequence& theOther)
{
Assign(theOther);
}
//=======================================================================
//function : Append
//purpose : Appends a Sequence to myself