Skip to content

Commit

Permalink
Resolve symbol ambiguity when building with Unity Build
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Fabian Kosmale <[email protected]>
Reviewed-by: Qt CI Bot <[email protected]>
  • Loading branch information
amirmasoudabdol committed May 4, 2023
1 parent 038c1c5 commit a0923d5
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/corelib/tools/qflatmap_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ class QFlatMapValueCompare : protected Compare
}
};

namespace qflatmap {
namespace detail {
template <class T>
class QFlatMapMockPointer
Expand All @@ -100,15 +101,17 @@ class QFlatMapMockPointer
}
};
} // namespace detail
} // namespace qflatmap

template<class Key, class T, class Compare = std::less<Key>, class KeyContainer = QList<Key>,
class MappedContainer = QList<T>>
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;
Expand Down

0 comments on commit a0923d5

Please sign in to comment.