diff options
author | Mikhail Svetkin <mikhail.svetkin@qt.io> | 2018-08-30 11:49:44 +0200 |
---|---|---|
committer | Mikhail Svetkin <mikhail.svetkin@qt.io> | 2018-09-06 13:20:28 +0000 |
commit | e8dacba47a59944e4a5ca271c4698e5dfbdbe9d5 (patch) | |
tree | 87b2d1d19275b031dcf0f4e4a6001cae368c684c /src/gui/itemmodels | |
parent | f4d9dadabbee7d32f135ca403f39b3c6ed1c34c8 (diff) |
QOffsetStringArray: fix compilation error with MSVC15/17
MSVC 2015/2017 has a bug with constexpr.
It is internal compiler error when we are using QtPrivate::IndexSequence
with more than 1024 items.
Example:
template<int ... I>
void foo(QtPrivate::IndexSequence<I...>) { }
void bar() {
foo(QtPrivate::makeIndexSequence<1024>()); // works
foo(QtPrivate::makeIndexSequence<1025>()); // error: C1202: recursive type or function dependency context too complex
}
Workaround:
template<typename>
struct Foo;
template<int ... I>
struct Foo<QtPrivate::IndexSequence<I...>>{
static constexpr void call() { }
};
void bar() {
Foo<QtPrivate::makeIndexSequence<1025>>::call(); // works
}
Change-Id: Iedbf5291ac4a9f51f8b5f6b76b83baba920c092d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/gui/itemmodels')
0 files changed, 0 insertions, 0 deletions