Skip to content

Commit

Permalink
remove constexpr on multiline functions for C++11
Browse files Browse the repository at this point in the history
  • Loading branch information
maxbachmann committed Dec 25, 2024
1 parent ae22db4 commit c3015c8
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 17 deletions.
1 change: 1 addition & 0 deletions .github/workflows/linux-simple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ jobs:
name: ${{matrix.compiler.cxx}}, C++${{matrix.std}}, ${{matrix.build_type}}
runs-on: ubuntu-20.04
strategy:
fail-fast: false
matrix:
compiler:
- {cxx: g++-5, other_pkgs: g++-5}
Expand Down
23 changes: 14 additions & 9 deletions extras/rapidfuzz_amalgamated.hpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Licensed under the MIT License <http://opensource.org/licenses/MIT>.
// SPDX-License-Identifier: MIT
// RapidFuzz v1.0.2
// Generated: 2024-12-25 11:29:11.666527
// Generated: 2024-12-25 11:44:52.213162
// ----------------------------------------------------------
// This file is an amalgamation of multiple different files.
// You probably shouldn't edit it directly.
Expand Down Expand Up @@ -5074,7 +5074,7 @@ struct MultiLCSseq : public detail::MultiSimilarityBase<MultiLCSseq<MaxLen>, siz
friend detail::MultiSimilarityBase<MultiLCSseq<MaxLen>, size_t, 0, std::numeric_limits<int64_t>::max()>;
friend detail::MultiNormalizedMetricBase<MultiLCSseq<MaxLen>, size_t>;

constexpr static size_t get_vec_size()
RAPIDFUZZ_CONSTEXPR_CXX14 static size_t get_vec_size()
{
# ifdef RAPIDFUZZ_AVX2
using namespace detail::simd_avx2;
Expand All @@ -5093,7 +5093,7 @@ struct MultiLCSseq : public detail::MultiSimilarityBase<MultiLCSseq<MaxLen>, siz
static_assert(MaxLen <= 64, "expected MaxLen <= 64");
}

constexpr static size_t find_block_count(size_t count)
static size_t find_block_count(size_t count)
{
size_t vec_size = get_vec_size();
size_t simd_vec_count = detail::ceil_div(count, vec_size);
Expand Down Expand Up @@ -5559,7 +5559,12 @@ static inline size_t count_common_chars(const FlaggedCharsMultiword& flagged)
}

template <typename PM_Vec, typename InputIt1, typename InputIt2>
static inline FlaggedCharsWord flag_similar_characters_word(const PM_Vec& PM, const Range<InputIt1>&,
static inline FlaggedCharsWord flag_similar_characters_word(const PM_Vec& PM,
#ifdef NDEBUG
const Range<InputIt1>&,
#else
const Range<InputIt1>& P,
#endif
const Range<InputIt2>& T, size_t Bound)
{
assert(P.size() <= 64);
Expand Down Expand Up @@ -6415,7 +6420,7 @@ struct MultiJaro : public detail::MultiSimilarityBase<MultiJaro<MaxLen>, double,
# endif
}

constexpr static size_t find_block_count(size_t count)
static size_t find_block_count(size_t count)
{
size_t vec_size = get_vec_size();
size_t simd_vec_count = detail::ceil_div(count, vec_size);
Expand Down Expand Up @@ -8396,7 +8401,7 @@ struct MultiLevenshtein : public detail::MultiDistanceBase<MultiLevenshtein<MaxL
std::numeric_limits<int64_t>::max()>;
friend detail::MultiNormalizedMetricBase<MultiLevenshtein<MaxLen>, size_t>;

constexpr static size_t get_vec_size()
RAPIDFUZZ_CONSTEXPR_CXX14 static size_t get_vec_size()
{
# ifdef RAPIDFUZZ_AVX2
using namespace detail::simd_avx2;
Expand All @@ -8415,7 +8420,7 @@ struct MultiLevenshtein : public detail::MultiDistanceBase<MultiLevenshtein<MaxL
static_assert(MaxLen <= 64, "expected MaxLen <= 64");
}

constexpr static size_t find_block_count(size_t count)
static size_t find_block_count(size_t count)
{
size_t vec_size = get_vec_size();
size_t simd_vec_count = detail::ceil_div(count, vec_size);
Expand Down Expand Up @@ -8967,7 +8972,7 @@ struct MultiOSA
friend detail::MultiDistanceBase<MultiOSA<MaxLen>, size_t, 0, std::numeric_limits<int64_t>::max()>;
friend detail::MultiNormalizedMetricBase<MultiOSA<MaxLen>, size_t>;

constexpr static size_t get_vec_size()
RAPIDFUZZ_CONSTEXPR_CXX14 static size_t get_vec_size()
{
# ifdef RAPIDFUZZ_AVX2
using namespace detail::simd_avx2;
Expand All @@ -8986,7 +8991,7 @@ struct MultiOSA
static_assert(MaxLen <= 64, "expected MaxLen <= 64");
}

constexpr static size_t find_block_count(size_t count)
static size_t find_block_count(size_t count)
{
size_t vec_size = get_vec_size();
size_t simd_vec_count = detail::ceil_div(count, vec_size);
Expand Down
2 changes: 1 addition & 1 deletion rapidfuzz/distance/Jaro.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ struct MultiJaro : public detail::MultiSimilarityBase<MultiJaro<MaxLen>, double,
# endif
}

constexpr static size_t find_block_count(size_t count)
static size_t find_block_count(size_t count)
{
size_t vec_size = get_vec_size();
size_t simd_vec_count = detail::ceil_div(count, vec_size);
Expand Down
7 changes: 6 additions & 1 deletion rapidfuzz/distance/Jaro_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ static inline size_t count_common_chars(const FlaggedCharsMultiword& flagged)
}

template <typename PM_Vec, typename InputIt1, typename InputIt2>
static inline FlaggedCharsWord flag_similar_characters_word(const PM_Vec& PM, const Range<InputIt1>&,
static inline FlaggedCharsWord flag_similar_characters_word(const PM_Vec& PM,
#ifdef NDEBUG
const Range<InputIt1>&,
#else
const Range<InputIt1>& P,
#endif
const Range<InputIt2>& T, size_t Bound)
{
assert(P.size() <= 64);
Expand Down
4 changes: 2 additions & 2 deletions rapidfuzz/distance/LCSseq.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ struct MultiLCSseq : public detail::MultiSimilarityBase<MultiLCSseq<MaxLen>, siz
friend detail::MultiSimilarityBase<MultiLCSseq<MaxLen>, size_t, 0, std::numeric_limits<int64_t>::max()>;
friend detail::MultiNormalizedMetricBase<MultiLCSseq<MaxLen>, size_t>;

constexpr static size_t get_vec_size()
RAPIDFUZZ_CONSTEXPR_CXX14 static size_t get_vec_size()
{
# ifdef RAPIDFUZZ_AVX2
using namespace detail::simd_avx2;
Expand All @@ -102,7 +102,7 @@ struct MultiLCSseq : public detail::MultiSimilarityBase<MultiLCSseq<MaxLen>, siz
static_assert(MaxLen <= 64, "expected MaxLen <= 64");
}

constexpr static size_t find_block_count(size_t count)
static size_t find_block_count(size_t count)
{
size_t vec_size = get_vec_size();
size_t simd_vec_count = detail::ceil_div(count, vec_size);
Expand Down
4 changes: 2 additions & 2 deletions rapidfuzz/distance/Levenshtein.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ struct MultiLevenshtein : public detail::MultiDistanceBase<MultiLevenshtein<MaxL
std::numeric_limits<int64_t>::max()>;
friend detail::MultiNormalizedMetricBase<MultiLevenshtein<MaxLen>, size_t>;

constexpr static size_t get_vec_size()
RAPIDFUZZ_CONSTEXPR_CXX14 static size_t get_vec_size()
{
# ifdef RAPIDFUZZ_AVX2
using namespace detail::simd_avx2;
Expand All @@ -323,7 +323,7 @@ struct MultiLevenshtein : public detail::MultiDistanceBase<MultiLevenshtein<MaxL
static_assert(MaxLen <= 64, "expected MaxLen <= 64");
}

constexpr static size_t find_block_count(size_t count)
static size_t find_block_count(size_t count)
{
size_t vec_size = get_vec_size();
size_t simd_vec_count = detail::ceil_div(count, vec_size);
Expand Down
4 changes: 2 additions & 2 deletions rapidfuzz/distance/OSA.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ struct MultiOSA
friend detail::MultiDistanceBase<MultiOSA<MaxLen>, size_t, 0, std::numeric_limits<int64_t>::max()>;
friend detail::MultiNormalizedMetricBase<MultiOSA<MaxLen>, size_t>;

constexpr static size_t get_vec_size()
RAPIDFUZZ_CONSTEXPR_CXX14 static size_t get_vec_size()
{
# ifdef RAPIDFUZZ_AVX2
using namespace detail::simd_avx2;
Expand All @@ -138,7 +138,7 @@ struct MultiOSA
static_assert(MaxLen <= 64, "expected MaxLen <= 64");
}

constexpr static size_t find_block_count(size_t count)
static size_t find_block_count(size_t count)
{
size_t vec_size = get_vec_size();
size_t simd_vec_count = detail::ceil_div(count, vec_size);
Expand Down

0 comments on commit c3015c8

Please sign in to comment.