[fdo-internals] VC++ std::unordered_map issue

Karsten Winter karsten.winter at autodesk.com
Thu Jan 21 07:06:02 PST 2016

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 Winter
Software - Engineer
Solution Engineering, IPG- ICP

Autodesk S.a.r.l.
Worbstrasse 223
3073 G├╝mligen

Central   +41 (0)31 9582020
Fax         +41 (0)31 9582022

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

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/fdo-internals/attachments/20160121/6b5f68db/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 5078 bytes
Desc: image001.png
URL: <http://lists.osgeo.org/pipermail/fdo-internals/attachments/20160121/6b5f68db/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Utilities_ExpressionEngine.patch
Type: application/octet-stream
Size: 1504 bytes
Desc: Utilities_ExpressionEngine.patch
URL: <http://lists.osgeo.org/pipermail/fdo-internals/attachments/20160121/6b5f68db/attachment.obj>

More information about the fdo-internals mailing list