[Interest] QVector / std::vector and memory alignment

Konstantin Tokarev annulen at yandex.ru
Fri Dec 30 11:31:37 CET 2016



30.12.2016, 13:29, "Philippe" <philwave at gmail.com>:
>>  How is it ia win for std::vector to achieve next year what QVector has done
>>  for the past 7 or 8?
>
> Not to mention we are likely far away from the time C++17 becomes a
> requirement to use or build Qt.

To be fair, nothing prevents anyone from starting using C++1z right now in their projects, without waiting for it to become a requirement for Qt

>
> Philippe
>
> On Thu, 29 Dec 2016 10:03:03 -0200
> Thiago Macieira <thiago.macieira at intel.com> wrote:
>
>>  Em quinta-feira, 29 de dezembro de 2016, às 09:32:19 BRST, Giuseppe D'Angelo
>>  escreveu:
>>  > Il 29/12/2016 06:56, Philippe ha scritto:
>>  > > Sometimes there are discussions about what is best QVector vs
>>  > > std::vector, and here we have a good "plus" for QVector.
>>  >
>>  > In C++17 std::vector (well, std::allocator) must honour overly-aligned
>>  >
>>  > types:
>>  > > http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2016/p0035r4.html
>>  >
>>  > GCC 7 and Clang 4 already implement it.
>>  >
>>  > Before C++17 you could've used an aligned allocator like Boost.Align.
>>  > QVector doesn't allow custom allocators, so here we have a win for
>>  > std::vector.
>>
>>  How is it ia win for std::vector to achieve next year what QVector has done
>>  for the past 7 or 8?
>>
>>  --
>>  Thiago Macieira - thiago.macieira (AT) intel.com
>>    Software Architect - Intel Open Source Technology Center
>>
>>  _______________________________________________
>>  Interest mailing list
>>  Interest at qt-project.org
>>  http://lists.qt-project.org/mailman/listinfo/interest
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest

-- 
Regards,
Konstantin



More information about the Interest mailing list