Skip to content

Conversation

@joka921
Copy link
Member

@joka921 joka921 commented Oct 29, 2025

This commit includes C++17 compatibility fixes for the index module:

  • Replace inline constexpr variable initialization with function-based initialization for global atomics
  • Use QL_CONSTEXPR macro for static constexpr variables
  • Add QLEVER_CPP_17 preprocessor guards for expensive checks that use ranges
  • Replace inline constexpr with static constexpr where appropriate
  • Use constexpr lambda variables instead of C++20 consteval functions
  • Update three_way_comparison and equality operator macros for C++17
  • Replace std::accumulate with std::reduce where parallel execution is beneficial
  • Add backport headers for StartsWith/EndsWith and algorithm utilities
  • Fix conversion issues with int64_t vs int for Bool datatype

🤖 Generated with Claude Code

This commit includes C++17 compatibility fixes for the index module:
- Replace inline constexpr variable initialization with function-based initialization for global atomics
- Use QL_CONSTEXPR macro for static constexpr variables
- Add QLEVER_CPP_17 preprocessor guards for expensive checks that use ranges
- Replace inline constexpr with static constexpr where appropriate
- Use constexpr lambda variables instead of C++20 consteval functions
- Update three_way_comparison and equality operator macros for C++17
- Replace std::accumulate with std::reduce where parallel execution is beneficial
- Add backport headers for StartsWith/EndsWith and algorithm utilities
- Fix conversion issues with int64_t vs int for Bool datatype

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <[email protected]>
Copy link
Member Author

@joka921 joka921 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A first round of self-reviews.

Comment on lines +34 to +44
inline std::atomic<size_t>& BUFFER_SIZE_JOIN_PATTERNS_WITH_OSP() {
static std::atomic<size_t> value = 50'000;
return value;
}

// When merging the vocabulary, this many finished words are buffered
// before they are written to the output.
constinit inline std::atomic<size_t> BATCH_SIZE_VOCABULARY_MERGE = 10'000'000;
inline std::atomic<size_t>& BATCH_SIZE_VOCABULARY_MERGE() {
static std::atomic<size_t> value = 10'000'000;
return value;
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As those are not depending on anything, I can probably just use inline variables. (also below).

tracer.beginTrace("rewriteLocalVocabEntries");
rewriteLocalVocabEntriesAndBlankNodes(triples);
tracer.endTrace("rewriteLocalVocabEntries");
#ifndef QLEVER_CPP_17
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO Check if this commenting out is still needed...

// directly because of cyclic dependencies.
static constexpr std::string_view proxyTag = "LveIdProxy";
using IdProxy = ad_utility::TypedIndex<uint64_t, proxyTag>;
static inline constexpr ad_utility::IndexTag lveIdProxyTag = "LveIdProxy";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

only inline...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant