<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
        <title>Feature-testing for C++ Technical Specifications</title>
        <style type="text/css">
                .moot
                {
                        text-decoration: line-through;
                }
        </style>
</head>
<body>
        <table border="1">
                <tr>
                        <th>Doc. No.:</th>
                        <td>D3948</td>
                </tr>
                <tr>
                        <th>Date:</th>
                        <td>2014-02-20</td>
                </tr>
                <tr>
                        <th>Reply to:</th>
                        <td>Clark Nelson</td>
                </tr>
                <tr>
                        <th>Title:</th>
                        <td>Feature-testing recommendations for C++</td>
                </tr>
        </table>
        <h1>Feature-testing for C++ Technical Specifications</h1>
        <h2>Introduction</h2>
        <p>One of the primary reasons for defining the feature-test macros for C++14 in a document
                separate from the standard was to avoid even the impression that standard features
                are optional. Because features described in a Technical Specification are by definition
                optional, it is not clear that there is good justification for putting feature-testing
                facilities for a TS in a different document.</p>
        <p>It was important for someone to “back-fill” feature-testing facilities
                for the new features of C++14, so SG10 undertook that task. But going forward, it
                would probably be better for feature-testing to be considered as part of the design
                of a new feature, and a descriptive and unique macro name selected, when necessary,
                by those who understand it best.</p>
        <p>In addition, it is not clear that SG10 has yet adequately considered what to do about
                issues like ABI compatibility and versioning of interfaces for a library. It may
                well be that it would be more efficient for such discussions to happen in a library
                WG.</p>
        <p>For all these reasons, it seems that discussion of feature-testing should not be
                happening exclusively within SG10.</p>
        <hr />
        <p>The remainder of this document consists mainly of tables such as were used to drive
                discussions within SG10, to serve as starting points for discussions in other groups.</p>
        <p>Each table row references some WG21 document that serves as the basis of (part of)
                a Technical Specification that is either currently in flight or taking off. The
                date of the WG21 vote referencing that document is also included: in SG10's approach,
                if a feature-test macro is needed, that date is used to determine what value the
                macro should take.</p>
        <p>Some of these documents propose the addition of a new library header. This is called
                out, as the use of the header name with the <code>__has_include</code> feature can
                be used as a means of testing for a library feature. In addition, for some features,
                SG10 – or some especially diligent member thereof – has already proposed
                a macro name to be used to test for the presence of a new feature.</p>
        <p>It should be understood that tracking features at the level of WG21 documents is
                just a guideline and handy initial default. In particular, not every proposal applied
                to a WD is considered a new feature (and therefore not all have an associated feature-test
                macro); for example, WG21 votes that refer to an issue-list document are not included
                below.</p>
        <p>For each document, what should be done about feature-testing should be carefully
                considered. If a feature-test macro is not justified, rationale for the omission
                should be provided. It's also possible for a single document to describe what is
                actually more than one independent feature; if there are parts of a proposal that
                may be expected to be implemented separately, they should be considered to be separate
                features.</p>
        <p>Some of the proposal documents referenced by a WG21 vote have been made moot by later
                events. For the sake of completeness, these are included below, but the text of
                the table row is <span class="moot">struck out</span>.</p>
        <p>For summary and details of the work of SG10 so far, please see <a href="http://isocpp.org/std/standing-documents/sd-6-sg10-feature-test-recommendations">
                SD-6 at <code>isocpp.org</code></a>.</p>
        <h2>Project 18822: File System</h2>
        <table border="1">
                <thead>
                        <tr>
                                <th>Date</th>
                                <th>Doc. No.</th>
                                <th>Title</th>
                                <th>New Header</th>
                        </tr>
                </thead>
                <tbody>
                        <tr>
                                <td>2013-04</td>
                                <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3505.html">N3505</a>
                                </td>
                                <td>Filesystem Library Proposal</td>
                                <td><code><filesystem></code></td>
                        </tr>
                </tbody>
        </table>
        <h2>Project 19216: Networking</h2>
        <table border="1">
                <thead>
                        <tr>
                                <th>Date</th>
                                <th>Doc. No.</th>
                                <th>Title</th>
                                <th>New Header</th>
                        </tr>
                </thead>
                <tbody>
                        <tr class="moot">
                                <td>2013-09</td>
                                <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3783.pdf">N3783</a>
                                </td>
                                <td>Network Byte Order Conversion</td>
                                <td><code><net></code></td>
                        </tr>
                </tbody>
        </table>
        <p>The above was mooted in 2014-02 (Issaquah), when N3783 was instead adopted into the
                Library Fundamentals TS. It is expected that in 2014-06 (Rapperswil), a revision
                of <a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3827.html">N3827</a>
                (Working Draft Technical Specification - URI) will be adopted as or into the WD
                for this project. </p>
        <h2>Project 19217: Concepts Lite</h2>
        <table border="1">
                <thead>
                        <tr>
                                <th>Date</th>
                                <th>Doc. No.</th>
                                <th>Title</th>
                        </tr>
                </thead>
                <tbody>
                        <tr>
                                <td>2014-02</td>
                                <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3929.pdf">N3929</a>
                                </td>
                                <td>Technical Specification: Concepts</td>
                        </tr>
                </tbody>
        </table>
        <h2>Project 19568: Library Fundamentals</h2>
        <table border="1">
                <thead>
                        <tr>
                                <th>Date</th>
                                <th>Doc. No.</th>
                                <th>Title</th>
                                <th>New Header or Proposed Macro</th>
                        </tr>
                </thead>
                <tbody>
                        <tr class="moot">
                                <td>2013-04</td>
                                <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3672.html">N3672</a>
                                </td>
                                <td>A proposal to add a utility class to represent optional objects</td>
                                <td><code><optional></code></td>
                        </tr>
                        <tr>
                                <td>2014-02</td>
                                <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3783.pdf">N3783</a>
                                </td>
                                <td>Network Byte Order Conversion</td>
                                <td><code><net></code></td>
                        </tr>
                        <tr>
                                <td>2014-02</td>
                                <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3793.html">N3793</a>
                                </td>
                                <td>A proposal to add a utility class to represent optional objects</td>
                                <td><code><experimental/optional></code></td>
                        </tr>
                        <tr>
                                <td>2014-02</td>
                                <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3804.html">N3804</a>
                                </td>
                                <td>Any Library Proposal</td>
                                <td><code><experimental/any></code></td>
                        </tr>
                        <tr>
                                <td>2014-02</td>
                                <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3843.pdf">N3843</a>
                                </td>
                                <td>A SFINAE-Friendly std::common_type</td>
                                <td><code>__cpp_lib_common_type_sfinae</code></td>
                        </tr>
                        <tr>
                                <td>2014-02</td>
                                <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3866.html">N3866</a>
                                </td>
                                <td>Invocation type traits</td>
                        </tr>
                        <tr>
                                <td>2014-02</td>
                                <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3905.html">N3905</a>
                                </td>
                                <td>Extending std::search to use Additional Searching Algorithms</td>
                        </tr>
                        <tr>
                                <td>2014-02</td>
                                <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3915.pdf">N3915</a>
                                </td>
                                <td>apply() call a function with arguments from a tuple</td>
                        </tr>
                        <tr>
                                <td>2014-02</td>
                                <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3916.pdf">N3916</a>
                                </td>
                                <td>Polymorphic Memory Resources</td>
                                <td><code><experimental/memory_resource></code></td>
                        </tr>
                        <tr>
                                <td>2014-02</td>
                                <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3920.html">N3920</a>
                                </td>
                                <td>Extending shared_ptr to Support Arrays</td>
                        </tr>
                        <tr>
                                <td>2014-02</td>
                                <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3921.html">N3921</a>
                                </td>
                                <td>string_view: a non-owning reference to a string</td>
                                <td><code><experimental/string_view></code></td>
                        </tr>
                        <tr>
                                <td>2014-02</td>
                                <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3923.pdf">N3923</a>
                                </td>
                                <td>A SFINAE-Friendly std::iterator_traits</td>
                                <td><code>__cpp_lib_iterator_traits_sfinae</code></td>
                        </tr>
                        <tr>
                                <td>2014-02</td>
                                <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3925.pdf">N3925</a>
                                </td>
                                <td>A sample Proposal</td>
                                <td><code>__cpp_lib_sample</code></td>
                        </tr>
                        <tr>
                                <td>2014-02</td>
                                <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3932.txt">N3932</a>
                                </td>
                                <td>Variable Templates For Type Traits</td>
                        </tr>
                </tbody>
        </table>
        <h2>Project 19569: Arrays</h2>
        <table border="1">
                <thead>
                        <tr>
                                <th>Date</th>
                                <th>Doc. No.</th>
                                <th>Title</th>
                                <th>New Header or Proposed Macro</th>
                        </tr>
                </thead>
                <tbody>
                        <tr>
                                <td>2013-04</td>
                                <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3639.html">N3639</a>
                                </td>
                                <td>Runtime-sized arrays with automatic storage duration</td>
                                <td><code>__cpp_runtime_arrays</code></td>
                        </tr>
                        <tr>
                                <td>2013-04</td>
                                <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3662.html">N3662</a>
                                </td>
                                <td>C++ Dynamic Arrays</td>
                                <td><code><dynarray></code></td>
                        </tr>
                </tbody>
        </table>
        <h2>Project 19570: Parallelism</h2>
        <table border="1">
                <thead>
                        <tr>
                                <th>Date</th>
                                <th>Doc. No.</th>
                                <th>Title</th>
                        </tr>
                </thead>
                <tbody>
                        <tr>
                                <td>2014-02</td>
                                <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3850.pdf">N3850</a>
                                </td>
                                <td>Working Draft, Technical Specification for C++ Extensions for Parallelism</td>
                        </tr>
                </tbody>
        </table>
        <h2>Project 19571: Concurrency</h2>
        <table border="1">
                <thead>
                        <tr>
                                <th>Date</th>
                                <th>Doc. No.</th>
                                <th>Title</th>
                        </tr>
                </thead>
                <tbody>
                        <tr>
                                <td>2014-02</td>
                                <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2013/n3785.pdf">N3785</a>
                                </td>
                                <td>Executors and schedulers</td>
                        </tr>
                        <tr>
                                <td>2014-02</td>
                                <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3857.pdf">N3857</a>
                                </td>
                                <td>Improvements to std::future<T> and Related APIs</td>
                        </tr>
                </tbody>
        </table>
        <h2>Project ?????: Transactional Memory</h2>
        <table border="1">
                <thead>
                        <tr>
                                <th>Date</th>
                                <th>Doc. No.</th>
                                <th>Title</th>
                        </tr>
                </thead>
                <tbody>
                        <tr>
                                <td>2014-02</td>
                                <td><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2014/n3919.pdf">N3919</a>
                                </td>
                                <td>Transactional Memory Support for C++</td>
                        </tr>
                </tbody>
        </table>
</body>
</html>