In the LBLEEventDispatcher class defined in LBLE.h and implemented in LBLE.cpp, the EventTable type is a std::multimap container, and the implementation of both the dispatch() and the removeObserver() methods uses std::multimap::find() method to lookup the iterator to the first element in the m_table list.
In the LBLEEventDispatcher class defined in LBLE.h and implemented in LBLE.cpp, the EventTable type is a std::multimap container, and the implementation of both the
dispatch()
and theremoveObserver()
methods usesstd::multimap::find()
method to lookup the iterator to the first element in them_table
list.However, according to the C++ standard, the
std::multimap::find()
method does NOT guarantee to return the iterator of the first element for elements of the same key in the list, so the outcome of the these two methods could be STL-implementation-dependent.A possible workaround could be replacing the
std::multimap::find()
method calls withstd::multimap::lower_bound()
, which returns an iterator pointing to the first element that is not less than the specified key.