PVS: V572 It is odd that the object which was created using 'new' operator is immediately cast to another type

This commit is contained in:
wmayer
2020-07-17 14:38:43 +02:00
parent 16f953ad65
commit 4dae806188
2 changed files with 5 additions and 1 deletions

View File

@@ -129,6 +129,10 @@ SoFCUnifiedSelection::SoFCUnifiedSelection() : pcDocument(0)
SO_NODE_DEFINE_ENUM_VALUE(HighlightModes, OFF);
SO_NODE_SET_SF_ENUM_TYPE (highlightMode, HighlightModes);
// Documentation of SoFullPath:
// Since the SoFullPath is derived from SoPath and contains no private data, you can cast SoPath instances to the SoFullPath type.
// This will allow you to examine hidden children. Actually, you are not supposed to allocate instances of this class at all.
// It is only available as an "extended interface" into the superclass SoPath.
detailPath = static_cast<SoFullPath*>(new SoPath(20));
detailPath->ref();

View File

@@ -84,7 +84,7 @@ public:
virtual void* Produce () const
{
return (void*)(new CLASS);
return (new CLASS);
}
};