View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0029299 | Open CASCADE | OCCT:Foundation Classes | public | 2017-11-07 17:08 | 2018-06-29 21:19 |
Reporter | kgv | Assigned To | bugmaster | ||
Priority | normal | Severity | minor | ||
Status | closed | Resolution | fixed | ||
Target Version | 7.3.0 | Fixed in Version | 7.3.0 | ||
Summary | 0029299: Foundation Classes, NCollection - define explicit empty constructor for map classes | ||||
Description | Currently NCollection_Map, NCollection_DataMap define the following constructors:NCollection_DataMap (const Standard_Integer NbBuckets=1, const Handle(NCollection_BaseAllocator)& theAllocator = 0L) so that empty constructor is combined with initialization constructor by passing default arguments. This may lead to broken code, when constructor is called implicitly by converting unrelated value to Standard_Integer, which is the first argument of map class constructor. In the following example, NCollection_Map::Contains (const NCollection_Map&) is called instead of NCollection_Map::Contains (const Quantity_ColorRGBA& ) because enumeration value can be used to initialize NCollection_Map() implicitly (this is for msvc10, newer compilers might put error here due to ambiguity): NCollection_Map<Quantity_ColorRGBA, Quantity_ColorRGBAHasher> aColors; if (aColors.Contains (Quantity_NOC_LIGHTGOLDENROD2)) { std::cerr << " @@ KO\n"; } else { std::cerr << " @@ OK\n"; } Therefore, it is proposed defining explicit empty constructor and marking current constructor with explicit keyword. | ||||
Steps To Reproduce | N/A | ||||
Tags | No tags attached. | ||||
Test case number | Not required | ||||
|
Branch CR29299 has been created by kgv. SHA-1: ab11308b3179d06e8b740d0deca8cfc258089e33 Detailed log of new commits: Author: kgv Date: Tue Nov 7 17:23:29 2017 +0300 0029299: Foundation Classes, NCollection - define explicit empty constructor for map classes Ambiguous constructors have been marked with explicit keyword for classes NCollection_DataMap, NCollection_DoubleMap, NCollection_IndexedDataMap, NCollection_IndexedMap, NCollection_List, NCollection_LocalArray, NCollection_Map, NCollection_Sequence, NCollection_SparseArray, NCollection_UBTree, |
|
Patch is ready for review. http://jenkins-test-10.nnov.opencascade.com/view/CR29299-master-KGV |
|
Branch CR29299 has been updated forcibly by kgv. SHA-1: e9eb73d35b0ed0e66ca166a3fd35801366eedf08 |
|
No remarks, please integrate |
|
Combination - OCCT branch : CR29299 SHA-1: e9eb73d35b0ed0e66ca166a3fd35801366eedf08 Products branch : master was compiled on Linux, MacOS and Windows platforms and tested on optimize mode. Number of compiler warnings: No new/fixed warnings Regressions/Differences/Improvements: No regressions/differences CPU differences: Linux: OCCT Total CPU difference: 20701.46000000036 / 20729.730000000465 [-0.14%] Products Total CPU difference: 7924.590000000066 / 7934.890000000088 [-0.13%] Windows: OCCT Total CPU difference: 18760.555459198367 / 18506.86663299847 [+1.37%] Products Total CPU difference: 8032.959492999945 / 7981.338762099939 [+0.65%] Image differences : No differences that require special attention Memory differences : No differences that require special attention |
|
Branch CR29299 has been deleted by kgv. SHA-1: e9eb73d35b0ed0e66ca166a3fd35801366eedf08 |
occt: master b6a0525b 2017-11-07 14:23:29 Committer: bugmaster Details Diff |
0029299: Foundation Classes, NCollection - define explicit empty constructor for map classes Ambiguous constructors have been marked with explicit keyword for classes NCollection_DataMap, NCollection_DoubleMap, NCollection_IndexedDataMap, NCollection_IndexedMap, NCollection_List, NCollection_LocalArray, NCollection_Map, NCollection_Sequence, NCollection_SparseArray, NCollection_UBTree, |
Affected Issues 0029299 |
|
mod - src/NCollection/NCollection_DataMap.hxx | Diff File | ||
mod - src/NCollection/NCollection_DoubleMap.hxx | Diff File | ||
mod - src/NCollection/NCollection_IndexedDataMap.hxx | Diff File | ||
mod - src/NCollection/NCollection_IndexedMap.hxx | Diff File | ||
mod - src/NCollection/NCollection_List.hxx | Diff File | ||
mod - src/NCollection/NCollection_LocalArray.hxx | Diff File | ||
mod - src/NCollection/NCollection_Map.hxx | Diff File | ||
mod - src/NCollection/NCollection_Sequence.hxx | Diff File | ||
mod - src/NCollection/NCollection_SparseArray.hxx | Diff File | ||
mod - src/NCollection/NCollection_UBTree.hxx | Diff File |
Date Modified | Username | Field | Change |
---|---|---|---|
2017-11-07 17:08 | kgv | New Issue | |
2017-11-07 17:08 | kgv | Assigned To | => abv |
2017-11-07 17:24 | git | Note Added: 0072021 | |
2017-11-07 18:41 | kgv | Note Added: 0072022 | |
2017-11-07 18:41 | kgv | Status | new => resolved |
2017-11-07 18:41 | kgv | Description Updated | |
2017-11-07 21:32 | git | Note Added: 0072023 | |
2017-11-09 12:06 |
|
Note Added: 0072109 | |
2017-11-09 12:06 |
|
Assigned To | abv => bugmaster |
2017-11-09 12:06 |
|
Status | resolved => reviewed |
2017-11-09 12:46 | bugmaster | Test case number | => Not required |
2017-11-09 12:58 | bugmaster | Note Added: 0072112 | |
2017-11-09 12:58 | bugmaster | Status | reviewed => tested |
2017-11-10 10:13 | bugmaster | Changeset attached | => occt master b6a0525b |
2017-11-10 10:13 | bugmaster | Status | tested => verified |
2017-11-10 10:13 | bugmaster | Resolution | open => fixed |
2017-11-10 12:15 | git | Note Added: 0072159 | |
2018-02-18 00:01 |
|
Target Version | 7.4.0 => 7.3.0 |
2018-06-29 21:15 |
|
Fixed in Version | => 7.3.0 |
2018-06-29 21:19 |
|
Status | verified => closed |