#include "support/docstring.h"
#include "support/weighted_btree.h"
-#include <boost/assert.hpp>
+#include "support/lassert.h"
namespace lyx {
docstring const & WordList::word(size_t idx) const
{
Impl::Words::const_iterator it = d->words_.find_summed_weight(idx);
- BOOST_ASSERT(it != d->words_.end());
- return it->first;
+ LASSERT(it != d->words_.end(), /**/);
+
+ // We use the key() method here, and not something like it->first
+ // because the btree only returns (iterator-) temporary value pairs.
+ // If we returned the first component of those here, we get an
+ // invalid reference and therefore strange crashes.
+ return it.key();
}