mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-08 14:17:06 +03:00
0027111: Add generalized copy constructor in handle class for old compilers
Copy constructor and assignment operator from handle of derived type is added in handle class. They are enabled only if macro OCC_HANDLE_NOCASTS is defined, and operators of cast of handle to reference to handle to base type are disabled in that case. Useless type casts to handle to base type are removed in GC and GCE2d classes. Code returning reference to handle from function is corrected to return it either by value or as reference to handle of actual type.
This commit is contained in:
@@ -68,7 +68,7 @@ void TopOpeBRepBuild_LoopSet::NextLoop()
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Handle(TopOpeBRepBuild_Loop)& TopOpeBRepBuild_LoopSet::Loop() const
|
||||
Handle(TopOpeBRepBuild_Loop) TopOpeBRepBuild_LoopSet::Loop() const
|
||||
{
|
||||
const Handle(TopOpeBRepBuild_Loop)& L = myLoopIterator.Value();
|
||||
return L;
|
||||
|
@@ -48,7 +48,7 @@ public:
|
||||
|
||||
Standard_EXPORT virtual void NextLoop();
|
||||
|
||||
Standard_EXPORT virtual const Handle(TopOpeBRepBuild_Loop)& Loop() const;
|
||||
Standard_EXPORT virtual Handle(TopOpeBRepBuild_Loop) Loop() const;
|
||||
|
||||
|
||||
|
||||
|
@@ -337,10 +337,9 @@ void TopOpeBRepBuild_PaveSet::NextLoop()
|
||||
//purpose :
|
||||
//=======================================================================
|
||||
|
||||
const Handle(TopOpeBRepBuild_Loop)& TopOpeBRepBuild_PaveSet::Loop()const
|
||||
Handle(TopOpeBRepBuild_Loop) TopOpeBRepBuild_PaveSet::Loop()const
|
||||
{
|
||||
const Handle(TopOpeBRepBuild_Loop)& L = myVerticesIt.Value();
|
||||
return L;
|
||||
return Handle(TopOpeBRepBuild_Loop)(myVerticesIt.Value());
|
||||
}
|
||||
|
||||
|
||||
|
@@ -57,7 +57,7 @@ public:
|
||||
|
||||
Standard_EXPORT virtual void NextLoop() Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT virtual const Handle(TopOpeBRepBuild_Loop)& Loop() const Standard_OVERRIDE;
|
||||
Standard_EXPORT virtual Handle(TopOpeBRepBuild_Loop) Loop() const Standard_OVERRIDE;
|
||||
|
||||
Standard_EXPORT const TopoDS_Edge& Edge() const;
|
||||
|
||||
|
Reference in New Issue
Block a user