summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qoffsetstringarray_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Fix build with C++20Thiago Macieira2018-12-211-2/+0
| | | | | | Fixes: QTBUG-72614 Change-Id: I548dbfddb69b4fd6a0a3fffd1572614a383366a5 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* qdbuserror: Use qOffsetStringArray instead of script generated codeMikhail Svetkin2018-10-161-0/+3
| | | | | Change-Id: I2498702bcf4706cb717a7481cf6f81ceebb29ae8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QOffsetStringArray: fix compilation error with clang-802.0.42Mikhail Svetkin2018-10-011-1/+1
| | | | | | | | error: suggest braces around initialization of subobject [-Werror,-Wmissing-braces] return StaticString<N1 + N2>{ls[I1]..., rs.data[I2]...}; Change-Id: I30f5f50378f1faed648d092eefc5edb46e940239 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QOffsetStringArray: fix compilation error with ICC18Mikhail Svetkin2018-09-141-9/+6
| | | | | | | | error: expression must have a constant value static constexpr const auto messages = qOffsetStringArray( Change-Id: I80a6bf5b83f99a8325511ac8a14e0c9819e3d2b7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QOffsetStringArray/msvc: fix compilation warnings C4100Mikhail Svetkin2018-09-071-0/+6
| | | | | | | | | C4100 - identifier' : unreferenced formal parameter It happens when we call StaticStringBuilder::concatenate(StaticString<N>, StaticString<0>). StaticString<0> is ignored. Change-Id: Ic687bc865aa5d5e7425cbddbd614bde7dbb801df Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QOffsetStringArray: fix compilation error with MSVC15/17Mikhail Svetkin2018-09-061-42/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* Remove QConditional in favor of std::conditional/std::is_unsignedMikhail Svetkin2018-09-051-4/+4
| | | | | Change-Id: I5e0b9f640eb49aa7f5afdd4f3f15e027659e78ea Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* corelib/tools: Fix auto detection of QOffsetStringArray::m_offset typeMikhail Svetkin2018-08-281-12/+9
| | | | | | | | | | The previous implementation wrongly calculated the necessary data type to hold the offset indexes. It looked at the amount of elements, but instead we should look at value for the last element in the offset array Change-Id: I84c6985dc3c329df3bbc5a14f9789170877b65bb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* corelib/tools: Add QOffsetStringArray APIMikhail Svetkin2018-08-271-0/+211
This function allows to generate an array of offsets of substrings in a string at compile time. This produces less verbose and easier to maintain source code. Change-Id: I5774b8b91906f6191f2b1244a676c07e7eb15b47 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>