Annex C (informative) Compatibility [diff]

C.1 C++ and ISO C++ 2017 [diff.cpp17]

C.1.15 [depr]: compatibility features [diff.cpp17.depr]

Change: Remove uncaught_­exception.

Rationale: The function did not have a clear specification when multiple exceptions were active, and has been superseded by uncaught_­exceptions.

Effect on original feature: A valid C++ 2017 program that calls std​::​uncaught_­exception may fail to compile.
It might be revised to use std​::​uncaught_­exceptions instead, for clear and portable semantics.
Change: Remove support for adaptable function API.
Rationale: The deprecated support relied on a limited convention that could not be extended to support the general case or new language features.
It has been superseded by direct language support with decltype, and by the std​::​bind and std​::​not_­fn function templates.

Effect on original feature: A valid C++ 2017 program that relies on the presence of result_­type, argument_­type, first_­argument_­type, or second_­argument_­type in a standard library class may fail to compile.
A valid C++ 2017 program that calls not1 or not2, or uses the class templates unary_­negate or binary_­negate, may fail to compile.
Change: Remove redundant members from std​::​allocator.

Rationale: std​::​allocator was overspecified, encouraging direct usage in user containers rather than relying on std​::​allocator_­traits, leading to poor containers.

Effect on original feature: A valid C++ 2017 program that directly makes use of the pointer, const_­pointer, reference, const_­reference, rebind, address, construct, destroy, or max_­size members of std​::​allocator, or that directly calls allocate with an additional hint argument, may fail to compile.
Change: Remove raw_­storage_­iterator.

Rationale: The iterator encouraged use of algorithms that might throw exceptions, but did not return the number of elements successfully constructed that might need to be destroyed in order to avoid leaks.

Effect on original feature: A valid C++ 2017 program that uses this iterator class may fail to compile.
Change: Remove temporary buffers API.
Rationale: The temporary buffer facility was intended to provide an efficient optimization for small memory requests, but there is little evidence this was achieved in practice, while requiring the user to provide their own exception-safe wrappers to guard use of the facility in many cases.

Effect on original feature: A valid C++ 2017 program that calls get_­temporary_­buffer or return_­temporary_­buffer may fail to compile.
Change: Remove shared_­ptr​::​unique.

Rationale: The result of a call to this member function is not reliable in the presence of multiple threads and weak pointers.
The member function use_­count is similarly unreliable, but has a clearer contract in such cases, and remains available for well defined use in single-threaded cases.

Effect on original feature: A valid C++ 2017 program that calls unique on a shared_­ptr object may fail to compile.
Affected subclause: [depr.meta.types]
Change: Remove deprecated type traits.

Rationale: The traits had unreliable or awkward interfaces.
The is_­literal_­type trait provided no way to detect which subset of constructors and member functions of a type were declared constexpr.
The result_­of trait had a surprising syntax that could not report the result of a regular function type.
It has been superseded by the invoke_­result trait.

Effect on original feature: A valid C++ 2017 program that relies on the is_­literal_­type or result_­of type traits, on the is_­literal_­type_­v variable template, or on the result_­of_­t alias template may fail to compile.