This call on Android NDK
random_shuffle(node->elements.front(), node->elements.back());
causes a SIGBUS or SIGSEGV.
I’m using gnustl (shared/static makes no difference).
Also, I can’t switch stl libraries because I need exception support.
So far all other stl functions work flawlessly.
Use
node->elements.begin()andnode->elements.end().front()andback()return elements, not iterators. I presume thatnode->elementsis a collection of pointers; in that case,random_shufflewill try to randomize whatever’s in memory between the address of the first element and the address of the last element. This is not what you want.