Resolve symbol ambiguity when building with Unity Build

In unity build, we may get `error: reference to 'detail' is ambiguous`
between the `detail` namespace defined in `qpropertyprivate.h`, and
`qflatmap_p.h`. For now, this causes an issue during the compilation of
`qcalendar.cpp` and it may occur in other places where qflatmap is
included.

Pick-to: 6.5
Task-number: QTBUG-109394
Change-Id: Ie4bbb66543d26a5db58488e924333d98ce0adebf
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
This commit is contained in:
Amir Masoud Abdol 2023-05-01 10:58:24 +02:00
parent 038c1c5978
commit a0923d5d3a

View File

@ -83,6 +83,7 @@ public:
}
};
namespace qflatmap {
namespace detail {
template <class T>
class QFlatMapMockPointer
@ -100,6 +101,7 @@ public:
}
};
} // namespace detail
} // namespace qflatmap
template<class Key, class T, class Compare = std::less<Key>, class KeyContainer = QList<Key>,
class MappedContainer = QList<T>>
@ -107,8 +109,9 @@ class QFlatMap : private QFlatMapValueCompare<Key, T, Compare>
{
static_assert(std::is_nothrow_destructible_v<T>, "Types with throwing destructors are not supported in Qt containers.");
template <class U>
using mock_pointer = detail::QFlatMapMockPointer<U>;
template<class U>
using mock_pointer = qflatmap::detail::QFlatMapMockPointer<U>;
public:
using key_type = Key;
using mapped_type = T;