Fixed sorting assertion with some std::sort implementations.

Change-Id: Idd925c9cc5cd2a35e06f4d832734180f5c38378e
Tested: on Linux.
This commit is contained in:
Wouter van Oortmerssen
2017-02-13 09:49:16 -08:00
parent ec8038cc3d
commit 2d6e8f096b

View File

@@ -912,7 +912,9 @@ class Builder FLATBUFFERS_FINAL_CLASS {
auto comp = strcmp(as, bs);
// If this assertion hits, you've added two keys with the same value to
// this map.
assert(comp);
// TODO: Have to check for pointer equality, as some sort implementation
// apparently call this function with the same element?? Why?
assert(comp || &a == &b);
return comp < 0;
});
// First create a vector out of all keys.