Skip to content

Commit 2590f21

Browse files
committed
Properly use multimap for lookup in poly casting
relates USCiLab#356, still need final testing on MSVC
1 parent a917374 commit 2590f21

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

include/cereal/details/polymorphic_impl.hpp

+6-1
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,12 @@ namespace cereal
307307

308308
// Check to see if we have a previous uncommitted path in unregisteredRelations
309309
// that is shorter. If so, ignore this path
310-
auto hint = unregisteredRelations.find( parent );
310+
auto hintRange = unregisteredRelations.equal_range( parent );
311+
auto hint = hintRange.first;
312+
for( ; hint != hintRange.second; ++hint )
313+
if( hint->second.first == finalChild )
314+
break;
315+
311316
const bool uncommittedExists = hint != unregisteredRelations.end();
312317
if( uncommittedExists && (hint->second.second.size() <= newLength) )
313318
continue;

0 commit comments

Comments
 (0)