Skip to content

Commit 3d3e4b7

Browse files
committed
workaround msvc bug
1 parent 3bad552 commit 3d3e4b7

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

extern/rapidfuzz-cpp

src/Levenshtein/Levenshtein-c/_levenshtein.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,8 @@ static inline std::basic_string<uint32_t> lev_set_median(const std::vector<RF_St
486486

487487
for (size_t i = 0; i < strings.size(); i++) {
488488
visit(strings[i], [&](auto s1) {
489-
rapidfuzz::CachedLevenshtein scorer(s1);
489+
/* deduction guides are broken here on msvc */
490+
rapidfuzz::CachedLevenshtein<typename decltype(s1)::value_type> scorer(s1);
490491
double dist = 0.0;
491492

492493
/* below diagonal */
@@ -597,7 +598,8 @@ static inline double lev_edit_seq_distance(const std::vector<RF_String>& strings
597598
double x = (double)i + 1.0;
598599

599600
visit(strings1[i], [&](auto s1) {
600-
rapidfuzz::CachedIndel scorer(s1);
601+
/* deduction guides are broken here on msvc */
602+
rapidfuzz::CachedIndel<typename decltype(s1)::value_type> scorer(s1);
601603

602604
while (p != end) {
603605
size_t l = strings1[i].length + strings2_it->length;
@@ -662,7 +664,8 @@ static inline double lev_set_distance(const std::vector<RF_String>& strings1,
662664

663665
for (const auto& str2 : strings2)
664666
visit(str2, [&](auto s1) {
665-
rapidfuzz::CachedIndel scorer(s1);
667+
/* deduction guides are broken here on msvc */
668+
rapidfuzz::CachedIndel<typename decltype(s1)::value_type> scorer(s1);
666669
for (const auto& str1 : strings1)
667670
*(r++) = visit(str1, [&](auto s2) {
668671
return scorer.normalized_distance(s2);

0 commit comments

Comments
 (0)