Title
Add __cpp_lib_deduction_guides to feature test macros
Status
new
Section
[version.syn]
Submitter
Konstantin Varlamov

Created on 2021-11-09.00:00:00 last changed 7 days ago

Messages

Date: 2021-11-20.14:10:33

Proposed resolution:

This wording is relative to N4901.

  1. Modify [version.syn] as indicated:

    […]
    #define __cpp_lib_coroutine          201902L  // also in <coroutine>
    #define __cpp_lib_deduction_guides   201703L
      // also in <array>, <deque>, <forward_list>, <functional>, <list>, <map>,
      // <memory>, <optional>, <queue>, <regex>, <scoped_allocator>, <set>, <stack>,
      // <string>, <tuple>, <unordered_map>, <unordered_set>, <utility>, <valarray>,
      // <vector>
    #define __cpp_lib_destroying_delete  201806L  // also in <new>
    […]
    
Date: 2021-11-15.00:00:00

[ 2021-11-16; Konstantin Varlamov comments and improves wording ]

One potential topic of discussion is whether the new feature test macro needs to be defined in every library header that contains an explicit deduction guide. While this would be consistent with the current approach, no other macro is associated with such a large set of headers (20 headers in total, whereas the current record-holder is __cpp_lib_nonmember_container_access with 12 headers). For this reason, it should be considered whether perhaps the new macro should only be defined in <version> (which would, however, make it an outlier). The proposed wording currently contains an exhaustive list (note that the deduction guides for <mutex> were removed by LWG 2981).

Date: 2021-11-20.14:10:33

P0433R2, the proposal for adding deduction guides to the standard library, contained a recommendation to use __cpp_lib_deduction_guides as a feature test macro. However, it appears that this feature test macro has been accidentally omitted from the Standard when the paper was applied and probably needs to be added back.

Previous resolution [SUPERSEDED]:

This wording is relative to N4901.

  1. Modify [version.syn] as indicated:

    […]
    #define __cpp_lib_coroutine          201902L  // also in <coroutine>
    #define __cpp_lib_deduction_guides   201703L
      // also in <deque>, <forward_list>, <list>, <map>, <queue>, <set>, <stack>,
      // <unordered_map>, <unordered_set>, <vector>
    #define __cpp_lib_destroying_delete  201806L  // also in <new>
    […]
    
History
Date User Action Args
2021-11-20 14:10:33adminsetmessages: + msg12226
2021-11-13 13:09:44adminsetmessages: + msg12214
2021-11-09 00:00:00admincreate