View Issue Details

IDProjectCategoryView StatusLast Update
0026497CommunityOCCT:Foundation Classespublic2016-04-17 15:07
ReporterRoman Lygin Assigned Tobugmaster  
PrioritynormalSeverityintegration request 
Status closedResolutionwon't fix 
Product Version7.0.0 
Summary0026497: Restore explicit hierarchy of handles
DescriptionInitial implementation of template-based handles introduced in 7.0 alpha used independent handle classes and upcast with the help of reinterpret_cast. The latter is unsafe - see discussion starting at

Provided implementation restores explicit hierarchy and removes upcast operators.

Additionally, DEFINE_STANDARD_HANDLECLASS macro restores forward declaration of class C1 in order to better preserve source compatibility of user classes written as follows:
class foo : public bar
Steps To ReproduceN/A
TagsNo tags attached.
Test case number


related to 0024023 closedabv Open CASCADE Revamp the OCCT Handle 
related to 0027111 closedabv Community Add generalized copy constructor in handle class for old compilers 



2015-07-30 02:01

administrator   ~0043687

Branch CR26497 has been created by Roman Lygin.

SHA-1: b667253efa6ba8195ee1ed47b7ca1ec89bfb6678

Detailed log of new commits:

Author: Roman Lygin
Date: Thu Jul 30 02:00:20 2015 +0400

    0026497: Restore explicit hierarchy of handles


2015-08-12 11:53

manager   ~0044025

The patch does not compile; it is necessary to add #includes in many places to ensure that each class is defined where Handle to it is used.


2015-12-15 15:51

manager   ~0049161

Roman, please give your opinion if this issue is still relevant, taking into account my remarks on the subject at

Roman Lygin

2015-12-23 17:49

developer   ~0049533

We are currently having internal discussions on possible of course actions. Restoring a hierarchy would hardly be an option unless you decide this to restore yourself. One of the efforts is to enable upcast in the case of method overloads.

Roman Lygin

2016-01-15 14:05

developer   ~0049888

Reassigning to our developer in charge of porting to 7.0. We discover significant broken source compatibility due to broken handle hierarchy as we build with earlier MS Visual Studios (vc10 and vc11) with cases like:

void Foo (const Handle_Geom_Curve&);
void Foo (const Handle_Geom_Surface&);
Handle_Geom_BSplineSurface aBS;
Foo (aBS);

We will continue to experiment if restoring handles hierarchy is feasible as otherwise the damage is too dramatic.


2016-01-25 20:32

developer   ~0050120

We spent a lot of time trying to return handles hierarchy, but this seems to be an unreachable goal, especially for old compilers. Thus it was decided to change the way into minimization the efforts needed to migrate to new handles system for old compilers. See related integration request 0027111.


2016-04-17 15:07

administrator   ~0053253

Branch CR26497 has been deleted by kgv.

SHA-1: b667253efa6ba8195ee1ed47b7ca1ec89bfb6678

Issue History

Date Modified Username Field Change
2015-07-30 01:58 Roman Lygin New Issue
2015-07-30 01:58 Roman Lygin Assigned To => abv
2015-07-30 01:58 Roman Lygin Relationship added related to 0024023
2015-07-30 02:01 git Note Added: 0043687
2015-07-30 02:01 Roman Lygin Status new => resolved
2015-07-30 02:01 Roman Lygin Steps to Reproduce Updated
2015-08-12 11:53 abv Note Added: 0044025
2015-08-12 11:53 abv Assigned To abv => Roman Lygin
2015-08-12 11:53 abv Status resolved => assigned
2015-12-15 15:51 abv Note Added: 0049161
2015-12-15 15:51 abv Status assigned => feedback
2015-12-18 11:50 abv Target Version 7.0.0 => 7.1.0
2015-12-23 17:49 Roman Lygin Note Added: 0049533
2016-01-15 13:46 Roman Lygin Assigned To Roman Lygin => AlexanderZashivalov
2016-01-15 14:05 Roman Lygin Note Added: 0049888
2016-01-15 14:05 Roman Lygin Status feedback => assigned
2016-01-21 16:30 Roman Lygin Relationship added related to 0026377
2016-01-21 16:31 Roman Lygin Relationship deleted related to 0026377
2016-01-25 20:28 AlexanderZashivalov Relationship added related to 0027111
2016-01-25 20:32 AlexanderZashivalov Note Added: 0050120
2016-02-29 10:57 AlexanderZashivalov Assigned To AlexanderZashivalov => bugmaster
2016-02-29 11:06 abv Status assigned => closed
2016-02-29 11:06 abv Resolution open => won't fix
2016-02-29 11:06 abv Target Version 7.1.0 =>
2016-04-17 15:07 git Note Added: 0053253