Skip to content

Commit

Permalink
Add explicit deduction guide for qxFuncAggregate when using Clang
Browse files Browse the repository at this point in the history
Clang didn't suppor this C++20 feature (not needing the guide) until
Clang17.
  • Loading branch information
oblivioncth committed Oct 24, 2024
1 parent f51e50f commit cd2bc73
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/utility/include/qx/utility/qx-helpers.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,12 @@ struct qxFuncAggregate : Functors... {
using Functors::operator()...;
};

// Explicit deduction guide. Shouldn't be needed as of C++20 but Clang was late to the party
#ifdef Q_CC_CLANG
template<class... Ts>
qxFuncAggregate(Ts...) -> qxFuncAggregate<Ts...>;
#endif

//Non-namespace Functions----------------------------------------------------------
template <typename T>
const T qxAsConst(T&& t) { return std::move(t); }
Expand Down

0 comments on commit cd2bc73

Please sign in to comment.