Skip to content

Commit

Permalink
Merge pull request #13050 from Swiftb0y/fix/gh12981-qt6.7-optional-qd…
Browse files Browse the repository at this point in the history
…ebug

fix(util): fix ambigous overload error due to native qDebug impl for std::optional
  • Loading branch information
Holzhaus authored Apr 5, 2024
2 parents 7b19c11 + 31b56bc commit ac7b2a3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/util/optional.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
#pragma once

#include <QtDebug>
// support for QDebugging std::optional<T> has been added natively in Qt 6.7
// this definition clashes with Qt's so disable it.
#if QT_VERSION < QT_VERSION_CHECK(6, 7, 0)

#include <optional>

template<typename T>
Expand All @@ -11,3 +15,5 @@ inline QDebug operator<<(QDebug dbg, std::optional<T> arg) {
return dbg << "nullopt";
}
}

#endif

0 comments on commit ac7b2a3

Please sign in to comment.