VC++ std::unordered_map issue

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

VC++ std::unordered_map issue

Karsten Winter

Hi all

 

After solving the problem with the GetAllFile() method in FdoCommonFile.cpp, 2 other problems came up in the SHP unit tests.

The test case with selecting distinct values (SelectAggregatesTest.Select_distinct()) from the shape file was failing.

The problem was in the method FdoExpressionEngineUtilDataRead::Perform_Distinct().

Here filtering of duplicated entries in the hashmap was not working.

It’s related to the deprecation of stdext::hash_map. Visual Studio 2015 recommended to use std::unordered_map, which I did previously.

 

But the problem is when using a std::unordered_map and insert duplicated FdoByteArray as key is working. But the duplicated key should not be inserted!

I tested it with simple integers were it worked as expected that duplicated keys cannot be inserted.

 

So I use now std::map instead of std::unordered_map. In this method we do not use lookup operations on the map, but iterate trough.

 

Other usages of std::unordered_map, which I used to replace stdext::hash_map, use more often lookups but no equality check on the keys. So keep them as it is.

 

Attached you can find the patch for the Expression Engine.

 

This is a more critical fix, which I would like to fix before the branch.

 

Best regards

Karsten

 

Karsten Winter

Software - Engineer

Solution Engineering, IPG- ICP           

 

Autodesk S.a.r.l.

Worbstrasse 223

3073 G├╝mligen

Switzerland

 

Central   +41 (0)31 9582020

Fax         +41 (0)31 9582022

 

 

Description: Description: Description: Description: Description: Description: cid:C3593B93-B89C-44B0-A763-6E009A4C92D6

 

CONFIDENTIALITY NOTICE
This email transmission is intended only for the use of the individual or entity named above and may contain information that is confidential, privileged and exempt from disclosure under applicable law. If you are not the intended recipient, you are hereby notified that any disclosure, copying, distribution or use of any of the information contained in this transmission is strictly PROHIBITED

 


_______________________________________________
fdo-internals mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fdo-internals

Utilities_ExpressionEngine.patch (2K) Download Attachment