Programming Languages - C++ Extensions for Library Fundamentals

ISO/IEC TS 19568:2015 describes extensions to the C++ Standard Library (1.2). These extensions are classes and functions that are likely to be used widely within a program and/or on the interface boundaries between libraries written by different organizations. ISO/IEC TS 19568:2015 is non-normative. Some of the library components in this technical specification may be considered for standardization in a future version of C++, but they are not currently part of any C++ standard. Some of the components in this technical specification may never be standardized, and others may be standardized in a substantially changed form. The goal of ISO/IEC TS 19568:2015 is to build more widespread existing practice for an expanded C++ standard library. It gives advice on extensions to those vendors who wish to provide them.

Langages de programmation — Extensions C++ pour les fondamentaux de bibliothèque

General Information

Status
Withdrawn
Publication Date
29-Sep-2015
Withdrawal Date
29-Sep-2015
Current Stage
9599 - Withdrawal of International Standard
Start Date
30-Mar-2017
Completion Date
30-Oct-2025
Ref Project

Relations

Technical specification
ISO/IEC TS 19568:2015 - Programming Languages -- C++ Extensions for Library Fundamentals
English language
81 pages
sale 15% off
Preview
sale 15% off
Preview

Frequently Asked Questions

ISO/IEC TS 19568:2015 is a technical specification published by the International Organization for Standardization (ISO). Its full title is "Programming Languages - C++ Extensions for Library Fundamentals". This standard covers: ISO/IEC TS 19568:2015 describes extensions to the C++ Standard Library (1.2). These extensions are classes and functions that are likely to be used widely within a program and/or on the interface boundaries between libraries written by different organizations. ISO/IEC TS 19568:2015 is non-normative. Some of the library components in this technical specification may be considered for standardization in a future version of C++, but they are not currently part of any C++ standard. Some of the components in this technical specification may never be standardized, and others may be standardized in a substantially changed form. The goal of ISO/IEC TS 19568:2015 is to build more widespread existing practice for an expanded C++ standard library. It gives advice on extensions to those vendors who wish to provide them.

ISO/IEC TS 19568:2015 describes extensions to the C++ Standard Library (1.2). These extensions are classes and functions that are likely to be used widely within a program and/or on the interface boundaries between libraries written by different organizations. ISO/IEC TS 19568:2015 is non-normative. Some of the library components in this technical specification may be considered for standardization in a future version of C++, but they are not currently part of any C++ standard. Some of the components in this technical specification may never be standardized, and others may be standardized in a substantially changed form. The goal of ISO/IEC TS 19568:2015 is to build more widespread existing practice for an expanded C++ standard library. It gives advice on extensions to those vendors who wish to provide them.

ISO/IEC TS 19568:2015 is classified under the following ICS (International Classification for Standards) categories: 35.060 - Languages used in information technology. The ICS classification helps identify the subject area and facilitates finding related standards.

ISO/IEC TS 19568:2015 has the following relationships with other standards: It is inter standard links to ISO/IEC TS 19568:2017. Understanding these relationships helps ensure you are using the most current and applicable version of the standard.

You can purchase ISO/IEC TS 19568:2015 directly from iTeh Standards. The document is available in PDF format and is delivered instantly after payment. Add the standard to your cart and complete the secure checkout process. iTeh Standards is an authorized distributor of ISO standards.

Standards Content (Sample)


TECHNICAL ISO/IEC TS
SPECIFICATION 19568
First edition
2015-10-01
Programming Languages — C++
Extensions for Library Fundamentals
Langages de programmation — Extensions C++ pour les
fondamentaux de bibliothèque
Reference number
©
ISO/IEC 2015
© ISO/IEC 2015, Published in Switzerland
�ll ri�ht� re�erved. �nle�� otherwi�e ��e�i�ied, no �art o� thi� ���li�ation �a� �e re�rod��ed or �tilized otherwi�e in an� �or�
or �� an� �ean�, ele�troni� or �e�hani�al, in�l�din� �hoto�o��in�, or �o�tin� on the internet or an intranet, witho�t �rior
written �er�i��ion. Per�i��ion �an �e re��e�ted �ro� either �S� at the addre�� �elow or �S��� �e��er �od� in the �o�ntr� o�
the requester.
�S� �o��ri�ht o��i�e
Ch. de Blandonnet 8 • CP 401
CH-1214 Vernier, Geneva, Switzerland
Tel. +41 22 749 01 11
Fax +41 22 749 09 47
�o��ri�ht�i�o.or�
www.iso.org
ii © ISO/IEC 2015 – All rights reserved

Contents
Foreword . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1 General . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.1 Scope . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2 Normative references . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.3 Namespaces, headers, and modifications to standard classes . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.4 Terms and definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.5 Future plans (Informative) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.6 Feature-testing recommendations (Informative) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2 Modifications to the C++ Standard Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.1 Uses-allocator construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
3 General utilities library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1 Utility components . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1.1 Header synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.1.2 Class erased_type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2 Tuples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2.1 Header synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
3.2.2 Calling a function with a tuple of arguments . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3 Metaprogramming and type traits . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3.1 Header synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
3.3.2 Other type transformations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.4 Compile-time rational arithmetic . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.4.1 Header synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
3.5 Time utilities . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.5.1 Header synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.6 System error support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.6.1 Header synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . 17
4 Function objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.1 Header synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
4.2 Class template function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
4.2.1 function construct/copy/destroy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.2.2 function modifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.3 Searchers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.3.1 Class template default_searcher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
4.3.1.1 default_searcher creation functions . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.3.2 Class template boyer_moore_searcher . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
4.3.2.1 boyer_moore_searcher creation functions . . . . . . . . . . . . . . . . . . . . . . . 24
4.3.3 Class template boyer_moore_horspool_searcher . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.3.3.1 boyer_moore_horspool_searcher creation functions . . . . . . . . . . . . . . . . . . 25
5 Optional objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.1 In general . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.2 Header synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
5.3 optional for object types . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
5.3.1 Constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
5.3.2 Destructor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
5.3.3 Assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
5.3.4 Swap . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.3.5 Observers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
5.4 In-place construction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
© ISO/IEC 2015 — All rights reserved 3

5.5 No-value state indicator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
5.6 Class bad_optional_access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.7 Relational operators . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.8 Comparison with nullopt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
5.9 Comparison with T . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
5.10 Specialized algorithms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
5.11 Hash support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37
6 Class any . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
6.1 Header synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
6.2 Class bad_any_cast . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
6.3 Class any . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
6.3.1 any construct/destruct . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
6.3.2 any assignments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
6.3.3 any modifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.3.4 any observers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
6.4 Non-member functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
7 string_view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
7.1 Header synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
7.2 Class template basic_string_view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
7.3 basic_string_view constructors and assignment operators . . . . . . . . . . . . . . . . . . . . . . . . . 46
7.4 basic_string_view iterator support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
7.5 basic_string_view capacity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
7.6 basic_string_view element access . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
7.7 basic_string_view modifiers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
7.8 basic_string_view string operations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
7.8.1 Searching basic_string_view . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
7.9 basic_string_view non-member comparison functions . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
7.10 Inserters and extractors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
7.11 Hash support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 53
8 Memory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
8.1 Header synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
8.2 Shared-ownership pointers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
8.2.1 Class template shared_ptr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
8.2.1.1 shared_ptr constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
8.2.1.2 shared_ptr observers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 61
8.2.1.3 shared_ptr casts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
8.2.2 Class template weak_ptr . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 63
8.2.2.1 weak_ptr constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
8.3 Type-erased allocator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
8.4 Header synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
8.5 Class memory_resource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
8.5.1 Class memory_resource overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
8.5.2 memory_resource public member functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
8.5.3 memory_resource protected virtual member functions . . . . . . . . . . . . . . . . . . . . . . 66
8.5.4 memory_resource equality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
8.6 Class template polymorphic_allocator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
8.6.1 Class template polymorphic_allocator overview . . . . . . . . . . . . . . . . . . . . . . . . . . 67
8.6.2 polymorphic_allocator constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
8.6.3 polymorphic_allocator member functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
8.6.4 polymorphic_allocator equality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
8.7 template alias resource_adaptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
8.7.1 resource_adaptor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70
4 © ISO/IEC 2015 — All rights reserved

8.7.2 resource_adaptor_imp constructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
8.7.3 resource_adaptor_imp member functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
8.8 Access to program-wide memory_resource objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
8.9 Pool resource classes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
8.9.1 Classes synchronized_pool_resource and unsynchronized_pool_resource . . . . . . . . . . . . 72
8.9.2 pool_options data members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
8.9.3 pool resource constructors and destructors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
8.9.4 pool resource members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
8.10 Class monotonic_buffer_resource . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
8.10.1 Class monotonic_buffer_resource overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76
8.10.2 monotonic_buffer_resource constructor and destructor . . . . . . . . . . . . . . . . . . . . . . 77
8.10.3 monotonic_buffer_resource members . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
8.11 Alias templates using polymorphic memory resources . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
8.11.1 Header synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 78
8.11.2 Header synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
8.11.3 Header synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
8.11.4 Header synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
8.11.5 Header synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
8.11.6 Header synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
8.11.7 Header synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
8.11.8 Header synopsis . . . . . . . . . . . . . . . . . . . . . . . . . 81
8.11.9 Header synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . 82
8.11.10 Header synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
9 Futures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
9.1 Header synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
9.2 Class template promise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83
9.3 Class template packaged_task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
10 Algorithms library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
10.1 Header synopsis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
10.2 Search . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86
10.3 Shuffling and sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
© ISO/IEC 2015 — All rights reserved 5

Foreword
ISO (the International Organization for Standardization) and IEC (the International Electrotechnical
Commission) form the specialized system for worldwide standardization. National bodies that are
members of ISO or IEC participate in the development of International Standards through technical
committees established by the respective organization to deal with particular fields of technical
activity. ISO and IEC technical committees collaborate in fields of mutual interest. Other
international organizations, governmental and non‐governmental, in liaison with ISO and IEC, also
take part in the work. In the field of information technology, ISO and IEC have established a joint
technical committee, ISO/IEC JTC 1.
The procedures used to develop this document and those intended for its further maintenance are
described in the ISO/IEC Directives, Part 1. In particular the different approval criteria needed for
the different types of document should be noted. This document was drafted in accordance with the
editorial rules of the ISO/IEC Directives, Part 2 (see www.iso.org/directives).
Attention is drawn to the possibility that some of the elements of this document may be the subject
of patent rights. ISO and IEC shall not be held responsible for identifying any or all such patent
rights. Details of any patent rights identified during the development of the document will be in the
Introduction and/or on the ISO list of patent declarations received (see www.iso.org/patents).
Any trade name used in this document is information given for the convenience of users and does
not constitute an endorsement.
For an explanation on the meaning of ISO specific terms and expressions related to conformity
assessment, as well as information about ISO's adherence to the WTO principles in the Technical
Barriers to Trade (TBT), see the following URL: Foreword — Supplementary information.
The committee responsible for this document is ISO/IEC JTC 1.
6 © ISO/IEC 2015 — All rights reserved

1 General [general]
1.1 Scope [general.scope]
This technical specification describes extensions to the C++ Standard Library (1.2). These extensions are classes and
functions that are likely to be used widely within a program and/or on the interface boundaries between libraries written
by different organizations.
This technical specification is non-normative. Some of the library components in this technical specification may be
considered for standardization in a future version of C++, but they are not currently part of any C++ standard. Some of
the components in this technical specification may never be standardized, and others may be standardized in a
substantially changed form.
The goal of this technical specification is to build more widespread existing practice for an expanded C++ standard
library. It gives advice on extensions to those vendors who wish to provide them.
1.2 Normative references [general.references]
The following referenced document is indispensable for the application of this document. For dated references, only the
edition cited applies. For undated references, the latest edition of the referenced document (including any amendments)
applies.
— ISO/IEC 14882:2014, Programming Languages — C++
ISO/IEC 14882:— is herein called the C++ Standard. References to clauses within the C++ Standard are written as
"C++14 §3.2". The library described in ISO/IEC 14882:— clauses 17–30 is herein called the C++ Standard Library.
Unless otherwise specified, the whole of the C++ Standard's Library introduction (C++14 §17) is included into this
Technical Specification by reference.
1.3 Namespaces, headers, and modifications to standard classes [general.namespaces]
Since the extensions described in this technical specification are experimental and not part of the C++ standard library,
they should not be declared directly within namespace std. Unless otherwise specified, all components described in this
technical specification either:
— modify an existing interface in the C++ Standard Library in-place,
— are declared in a namespace whose name appends ::experimental::fundamentals_v1 to a namespace defined
in the C++ Standard Library, such as std or std::chrono, or
— are declared in a subnamespace of a namespace described in the previous bullet, whose name is not the same as
an existing subnamespace of namespace std.
[ Example: This TS does not define std::experimental::fundamentals_v1::chrono because the C++ Standard Library
defines std::chrono. This TS does not define std::pmr::experimental::fundamentals_v1 because the C++ Standard
Library does not define std::pmr. — end example ]
Each header described in this technical specification shall import the contents of std::experimental::fundamentals_v1
into std::experimental as if by
namespace std {
namespace experimental {
inline namespace fundamentals_v1 {}
}
}
© ISO/IEC 2015 — All rights reserved 7

This technical specification also describes some experimental modifications to existing interfaces in the C++ Standard
Library. These modifications are described by quoting the affected parts of the standard and using underlining to represent
added text and strike-through to represent deleted text.
Unless otherwise specified, references to other entities described in this technical specification are assumed to be
qualified with std::experimental::fundamentals_v1::, and references to entities described in the standard are
assumed to be qualified with std::.
Extensions that are expected to eventually be added to an existing header are provided inside the
header, which shall include the standard contents of as if by
#include
New headers are also provided in the directory, but without such an #include.
Table 1 — C++ library headers








1.4 Terms and definitions [general.defns]
For the purposes of this document, the terms and definitions given in the C++ Standard and the following apply.
1.4.1 [general.defns.direct-non-list-init]
direct-non-list-initialization
A direct-initialization that is not list-initialization.
1.5 Future plans (Informative) [general.plans]
This section describes tentative plans for future versions of this technical specification and plans for moving content into
future versions of the C++ Standard.
The C++ committee intends to release a new version of this technical specification approximately every year, containing
the library extensions we hope to add to a near-future version of the C++ Standard. Future versions will define their
contents in std::experimental::fundamentals_v2, std::experimental::fundamentals_v3, etc., with the most recent
implemented version inlined into std::experimental.
When an extension defined in this or a future version of this technical specification represents enough existing practice, it
will be moved into the next version of the C++ Standard by removing the experimental::fundamentals_vN segment of
its namespace and by removing the experimental/ prefix from its header's path.
1.6 Feature-testing recommendations (Informative) [general.feature.test]
For the sake of improved portability between partial implementations of various C++ standards, WG21 (the ISO technical
committee for the C++ programming language) recommends that implementers and programmers follow the guidelines in
this section concerning feature-test macros. [ Note: WG21's SD-6 makes similar recommendations for the C++ Standard
itself. — end note ]
8 © ISO/IEC 2015 — All rights reserved

Implementers who provide a new standard feature should define a macro with the recommended name, in the same
circumstances under which the feature is available (for example, taking into account relevant command-line options), to
indicate the presence of support for that feature. Implementers should define that macro with the value specified in the
most recent version of this technical specification that they have implemented. The recommended macro name is
"__cpp_lib_experimental_" followed by the string in the "Macro Name Suffix" column.
Programmers who wish to determine whether a feature is available in an implementation should base that determination
on the presence of the header (determined with __has_include(

)) and the state of the macro with the
recommended name. (The absence of a tested feature may result in a program with decreased functionality, or the relevant
functionality may be provided in a different way. A program that strictly depends on support for a feature can just try to
use the feature unconditionally; presumably, on an implementation lacking necessary support, translation will fail.)
Table 2 — Significant features in this technical specification
Doc. Primary
Title Macro Name Suffix Value Header
No. Section
apply() call a
function with
N3915 3.2.2 apply 201402
arguments from a
tuple
Variable Templates
N3932 3.3.1 type_trait_variable_templates 201402
For Type Traits
N3866 Invocation type traits 3.3.2 invocation_type 201406
Type-erased allocator
N3916 4.2 function_erased_allocator 201406
for std::function
Extending
std::search to use
N3905 4.3 boyer_moore_searching 201411
Additional Searching
Algorithms
A utility class to
N3672,
represent optional 5 optional 201411
N3793
objects
Any Library
N3804 6 any 201411
Proposal
string_view: a non-
string_view
N3921 owning reference to 7 201411
a string
Extending shared_ptr
N3920 8.2 shared_ptr_arrays 201406
to Support Arrays
Polymorphic
N3916 8.4 memory_resources 201402
Memory Resources
Type-erased allocator
N3916 9.2 promise_erased_allocator 201406
for std::promise
Type-erased allocator
N3916 for 9.3 packaged_task_erased_allocator 201406
std::packaged_task
N3925 A sample Proposal 10.3 sample 201402
© ISO/IEC 2015 — All rights reserved 9

2 Modifications to the C++ Standard Library [mods]
Implementations that conform to this technical specification shall behave as if the modifications contained in this section
are made to the C++ Standard.
2.1 Uses-allocator construction [mods.allocator.uses]
The following changes to the uses_allocator trait and to the description of uses-allocator construction allow a
memory_resource pointer act as an allocator in many circumstances. [ Note: Existing programs that use standard
allocators would be unaffected by this change. — end note ]
20.7.7 uses_allocator [allocator.uses]
20.7.7.1 uses_allocator trait [allocator.uses.trait]
template struct uses_allocator;
Remarks: Automatically detects whether T has a nested allocator_type that is convertible from Alloc.
Meets the BinaryTypeTrait requirements (C++14 §20.10.1). The implementation shall provide a
definition that is derived from true_type if a type T::allocator_type exists and either
is_convertible_v != false or T::allocator_type is an alias for
std::experimental::erased_type (3.1.2), otherwise it shall be derived from false_type. A program
may specialize this template to derive from true_type for a user-defined type T that does not have a
nested allocator_type but nonetheless can be constructed with an allocator where either:
— the first argument of a constructor has type allocator_arg_t and the second argument has type
Alloc or
— the last argument of a constructor has type Alloc.
20.7.7.2 uses-allocator construction [allocator.uses.construction]
Uses-allocator construction with allocator Alloc refers to the construction of an object obj of type T, using
constructor arguments v1, v2, ., vN of types V1, V2, ., VN, respectively, and an allocator alloc of
, where Alloc either (1) meets the requirements of an allocator (C++14 §17.6.3.5), or (2) is a
type Alloc
pointer type convertible to std::experimental::pmr::memory_resource* (8.5), according to the following
rules:
10 © ISO/IEC 2015 — All rights reserved

3 General utilities library [utilities]
3.1 Utility components [utility]
3.1.1 Header synopsis [utility.synop]
#include
namespace std {
namespace experimental {
inline namespace fundamentals_v1 {
3.1.2, erased-type placeholder
struct erased_type { };
} // namespace fundamentals_v1
} // namespace experimental
} // namespace std
3.1.2 Class erased_type [utility.erased.type]
struct erased_type { };
The erased_type struct is an empty struct that serves as a placeholder for a type T in situations where the actual
type T is determined at runtime. For example, the nested type, allocator_type, is an alias for erased_type in
classes that use type-erased allocators (see 8.3).
3.2 Tuples [tuple]
3.2.1 Header synopsis [header.tuple.synop]
#include
namespace std {
namespace experimental {
inline namespace fundamentals_v1 {
// See C++14 §20.4.2.5, tuple helper classes
template constexpr size_t tuple_size_v
= tuple_size::value;
// 3.2.2, Calling a function with a tuple of arguments
template
constexpr decltype(auto) apply(F&& f, Tuple&& t);
} // namespace fundamentals_v1
} // namespace experimental
} // namespace std
© ISO/IEC 2015 — All rights reserved 11

3.2.2 Calling a function with a tuple of arguments [tuple.apply]
template
constexpr decltype(auto) apply(F&& f, Tuple&& t);
Effects: Given the exposition only function
template
constexpr decltype(auto) apply_impl( // exposition only
F&& f, Tuple&& t, index_sequence) {
return INVOKE(std::forward(f), std::get(std::forward(t)).);
}
Equivalent to
return apply_impl(std::forward(f), std::forward(t),
make_index_sequence>>{});
3.3 Metaprogramming and type traits [meta]
3.3.1 Header synopsis [meta.type.synop]
#include
namespace std {
namespace experimental {
inline namespace fundamentals_v1 {
// See C++14 §20.10.4.1, primary type categories
template constexpr bool is_void_v
= is_void::value;
template constexpr bool is_null_pointer_v
= is_null_pointer::value;
template constexpr bool is_integral_v
= is_integral::value;
template constexpr bool is_floating_point_v
= is_floating_point::value;
template constexpr bool is_array_v
= is_array::value;
template constexpr bool is_pointer_v
= is_pointer::value;
template constexpr bool is_lvalue_reference_v
= is_lvalue_reference::value;
template constexpr bool is_rvalue_reference_v
= is_rvalue_reference::value;
template constexpr bool is_member_object_pointer_v
= is_member_object_pointer::value;
template constexpr bool is_member_function_pointer_v
= is_member_function_pointer::value;
template constexpr bool is_enum_v
= is_enum::value;
template constexpr bool is_union_v
= is_union::value;
template constexpr bool is_class_v
12 © ISO/IEC 2015 — All rights reserved

= is_class::value;
template constexpr bool is_function_v
= is_function::value;
// See C++14 §20.10.4.2, composite type categories
template constexpr bool is_reference_v
= is_reference::value;
template constexpr bool is_arithmetic_v
= is_arithmetic::value;
template constexpr bool is_fundamental_v
= is_fundamental::value;
template constexpr bool is_object_v
= is_object::value;
template constexpr bool is_scalar_v
= is_scalar::value;
template constexpr bool is_compound_v
= is_compound::value;
template constexpr bool is_member_pointer_v
= is_member_pointer::value;
// See C++14 §20.10.4.3, type properties
template constexpr bool is_const_v
= is_const::value;
template constexpr bool is_volatile_v
= is_volatile::value;
template constexpr bool is_trivial_v
= is_trivial::value;
template constexpr bool is_trivially_copyable_v
= is_trivially_copyable::value;
template constexpr bool is_standard_layout_v
= is_standard_layout::value;
template constexpr bool is_pod_v
= is_pod::value;
template constexpr bool is_literal_type_v
= is_literal_type::value;
template constexpr bool is_empty_v
= is_empty::value;
template constexpr bool is_polymorphic_v
= is_polymorphic::value;
template constexpr bool is_abstract_v
= is_abstract::value;
template constexpr bool is_final_v
= is_final::value;
template constexpr bool is_signed_v
= is_signed::value;
template constexpr bool is_unsigned_v
= is_unsigned::value;
template constexpr bool is_constructible_v
= is_constructible::value;
template constexpr bool is_default_constructible_v
= is_default_constructible::value;
template constexpr bool is_copy_constructible_v
© ISO/IEC 2015 — All rights reserved 13

= is_copy_constructible::value;
template constexpr bool is_move_constructible_v
= is_move_constructible::value;
template constexpr bool is_assignable_v
= is_assignable::value;
template constexpr bool is_copy_assignable_v
= is_copy_assignable::value;
template constexpr bool is_move_assignable_v
= is_move_assignable::value;
template constexpr bool is_destructible_v
= is_destructible::value;
template constexpr bool is_trivially_constructible_v
= is_trivially_constructible::value;
template constexpr bool is_trivially_default_constructible_v
= is_trivially_default_constructible::value;
template constexpr bool is_trivially_copy_constructible_v
= is_trivially_copy_constructible::value;
template constexpr bool is_trivially_move_constructible_v
= is_trivially_move_constructible::value;
template constexpr bool is_trivially_assignable_v
= is_trivially_assignable::value;
template constexpr bool is_trivially_copy_assignable_v
= is_trivially_copy_assignable::value;
template constexpr bool is_trivially_move_assignable_v
= is_trivially_move_assignable::value;
template constexpr bool is_trivially_destructible_v
= is_trivially_destructible::value;
template constexpr bool is_nothrow_constructible_v
= is_nothrow_constructible::value;
template constexpr bool is_nothrow_default_constructible_v
= is_nothrow_default_constructible::value;
template constexpr bool is_nothrow_copy_constructible_v
= is_nothrow_copy_constructible::value;
template constexpr bool is_nothrow_move_constructible_v
= is_nothrow_move_constructible::value;
template constexpr bool is_nothrow_assignable_v
= is_nothrow_assignable::value;
template constexpr bool is_nothrow_copy_assignable_v
= is_nothrow_copy_assignable::value;
template constexpr bool is_nothrow_move_assignable_v
= is_nothrow_move_assignable::value;
template constexpr bool is_nothrow_destructible_v
= is_nothrow_destructible::value;
template constexpr bool has_virtual_destructor_v
= has_virtual_destructor::value;
// See C++14 §20.10.5, type property queries
template constexpr size_t alignment_of_v
= alignment_of::value;
template constexpr size_t rank_v
= rank::value;
template constexpr size_t extent_v
14 © ISO/IEC 2015 — All rights reserved

= extent::value;
// See C++14 §20.10.6, type relations
template constexpr bool is_same_v
= is_same::value;
template constexpr bool is_base_of_v
= is_base_of::value;
template constexpr bool is_convertible_v
= is_convertible::value;
// 3.3.2, Other type transformations
template class invocation_type; // not defined
template class invocation_type;
template class raw_invocation_type; // not defined
template class raw_invocation_type;
template
using invocation_type_t = typename invocation_type::type;
template
using raw_invocation_type_t = typename raw_invocation_type::type;
} // namespace fundamentals_v1
} // namespace experimental
} // namespace std
3.3.2 Other type transformations [meta.trans.other]
This sub-clause contains templates that may be used to transform one type to another following some predefined rule.
Each of the templates in this subclause shall be a TransformationTrait (C++14 §20.10.1).
Within this section, define the invocation parameters of INVOKE(f, t1, t2, ., tN) as follows, in which T1 is the
possibly cv-qualified type of t1 and U1 denotes T1& if t1 is an lvalue or T1&& if t1 is an rvalue:
— When f is a pointer to a member function of a class T the invocation parameters are U1 followed by the
parameters of f matched by t2, ., tN.
— When N == 1 and f is a pointer to member data of a class T the invocation parameter is U1.
— If f is a class object, the invocation parameters are the parameters matching t1, ., tN of the best viable
function (C++14 §13.3.3) for the arguments t1, ., tN among the function call operators of f.
— In all other cases, the invocation parameters are the parameters of f matching t1, . tN.
In all of the above cases, if an argument tI matches the ellipsis in the function's parameter-declaration-clause, the
corresponding invocation parameter is defined to be the result of applying the default argument promotions (C++14
§5.2.2) to tI.
[ Example: Assume S is defined as
struct S {
int f(double const &) const;
void operator()(int, int);
void operator()(char const *, int i = 2, int j = 3);
void operator()(.);
};
— The invocation parameters of INVOKE(&S::f, S(), 3.5) are (S &&, double const &).
— The invocation parameters of INVOKE(S(), 1, 2) are (int, int).
© ISO/IEC 2015 — All rights reserved 15

— The invocation parameters of INVOKE(S(), "abc", 5) are (const char *, int). The defaulted parameter j
does not correspond to an argument.
— The invocation paramete
...

Questions, Comments and Discussion

Ask us and Technical Secretary will try to provide an answer. You can facilitate discussion about the standard in here.

Loading comments...