Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
josuttis_nm_c20_the_complete_guide.pdf
Скачиваний:
44
Добавлен:
27.03.2023
Размер:
5.85 Mб
Скачать

698

 

Chapter 23: Small Improvements for the C++ Standard Library

 

 

 

for (double

value : coll) {

 

 

 

 

 

 

 

 

std::cout

<< value << '\n';

 

 

 

}

}

 

 

 

 

 

 

 

 

As usual for execution policies, you have no way of impacting when and how the policy is used. With this policy, you enable vectorization or SIMD computing; however, you do not mandate it. On hardware that does not support this policy, or if the implementation decides at runtime not to use it (e.g., because the CPU load is too high), the unseq policy results in sequential execution.

23.8Afternotes

The string member functions starts_with() and ends_with() were accepted as proposed by Mikhail Maltsev in http://wg21.link/p0457r2.

The restriction of the reserve() function of strings was first proposed by Andrew Luo in http:// wg21.link/lwg2968. The finally accepted wording was formulated by Mark Zeren and Andrew Luo in http://wg21.link/p0966r1.

Access to the source location was first proposed by Robert Douglas in http://wg21.link/n3972. The finally accepted wording was formulated by Robert Douglas, Corentin Jabot, Daniel Krugler,¨ and Peter Sommerlad in http://wg21.link/p1208r6.

The functions for safe integral comparisons were accepted as proposed by Federico Kircheis in http: //wg21.link/p0586r2.

The ssize() functions were discussed for a long time as a fix to the problem of comparing signed indexes with unsigned sizes. We would like to let all size() functions yield a signed value; however, there is the backward compatibility problem. As a reaction to a std::span proposal to use a signed size type, ssize() was first proposed by Robert Douglas, Nevin Liber, and Marshall Clow in http://wg21.link/ p1089r0. The finally accepted wording was formulated by Jorg Brown in http://wg21.link/p1227r2. std::ranges::ssize() was later added by Hannes Hauswedell, Jorg Brown, and Casey Carter in http: //wg21.link/p1970r2.

The mathematical constants were first proposed by Lev Minkovsky in http://wg21.link/p0631r0. The finally accepted wording was formulated by Lev Minkovsky and John McFarlane in http://wg21. link/p0631r8.

Bit operations were first proposed by Matthew Fioravante in http://wg21.link/n3864. The finally accepted wording was formulated by Jens Maurer in http://wg21.link/p0553r4 and http://wg21. link/p0556r3. The names were later modified as proposed by Vincent Reverdy in http://wg21.link/ p1956r1.

std::bit_cast<>() was introduced as finally proposed by JF Bastien in http://wg21.link/ p0476r2.

std::endian was first proposed by Howard Hinnant in http://wg21.link/p0463r0. The finally accepted wording was formulated by Howard Hinnant in http://wg21.link/p0463r1. The header file was later corrected as proposed by Walter E. Brown and Arthur O’Dwyer in http://wg21.link/p1612r1.

The header file <version> was accepted as proposed by Alan Talbot in http://wg21.link/p0754r2.

23.8 Afternotes

699

The new algorithms shift_left() and shift_right() were accepted as proposed by Dan Raviv in http://wg21.link/p0769r2. The new min/max algorithms for ranges were introduced with the ranges library as proposed in http://wg21.link/p0896r4.

The unseq execution policy was first proposed by Arch D. Robison, Pablo Halpern, Robert Geva, and Clark Nelson in http://wg21.link/p0076r0. The finally accepted wording was formulated by Alisdair Meredith and Pablo Halpern in http://wg21.link/p1001r2.

700

This page is intentionally left blank