pratapi / patl

Automatically exported from code.google.com/p/patl
0 stars 0 forks source link

levenshtein iter run-time assertion #3

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
insider.cpp demo causes a run-time assertion: 'vector subscript out of range'
(MSVC 9)

on this line in insider.cpp:
        StringSet::const_partimator<leven_dist>
            it = test1.begin(ld),
            itEnd = test1.end(ld);
here in partial_base.hpp:
            // sort & remove duplicates
            std::sort(
                &states_[current_end],
                &states_[states_.size()]);

Original issue reported on code.google.com by theli.ua on 6 Sep 2010 at 8:32

GoogleCodeExporter commented 8 years ago
// xd: fix a bug on original version, which cause debug assert in x64.
            std::sort(
                &(states_[0])+current_end,
                &(states_[0]) + states_.size());
            states_.resize(std::unique(
                &(states_[0])+current_end,
                &(states_[0])+states_.size()) - &(states_[0]));

Original comment by dxj19831...@gmail.com on 21 Feb 2012 at 2:30