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

22.4 Afternotes

681

As another example, the constructors of std::span<> are conditional explicit:

namespace std {

template<typename ElementType, size_t Extent = dynamic_extent> class span {

public:

static constexpr size_type extent = Extent;

...

constexpr span() noexcept; template<typename It>

constexpr explicit(extent != dynamic_extent) span(It first, size_type count);

template<typename It, typename End>

constexpr explicit(extent != dynamic_extent) span(It first, End last);

...

};

}

As a consequence, implicit type conversions of spans are allowed only if the spans have a dynamic extent.

22.4 Afternotes

Making typename optional in certain situations was first proposed by by Daveed Vandevoorde in http: //wg21.link/p0634r0. The finally accepted wording was formulated by Nina Ranns and Daveed Vandevoorde in http://wg21.link/p0634r3.

Class template argument deduction for aggregates was first proposed by Mike Spertus in http://wg21. link/p1021r0. The finally accepted wording was formulated by Timur Doumler in http://wg21.link/ p1816r0 and in http://wg21.link/p2082r1.

The conditional explicit feature was first proposed by Barry Revzin and Stephan T. Lavavej in http: //wg21.link/p0892r0. The finally accepted wording was formulated by Barry Revzin and Stephan T. Lavavej in http://wg21.link/p0892r2.

682

This page is intentionally left blank