C++ programming language has a lot of useful new classes, methods, templates, and keywords coming with the new C++ standards. Mostly they are new or enhanced versions of previous ones from the older standard. Because of new modern technologies and software requirements, some of these features are being deprecated and some are being removed. In this post, we will list deprecated C++14 features in C++17 and affect to standards beyond.
Table of Contents
What are the deprecated C++14 features in C++17?
Deprecate redeclaration of static constexpr class members
The constexprs
specifier implies inline
only for static data members, not also for namespace-scope variables.
In example, if there is a struct stX { static constexpr int i = 100; };
, int stX::i;
then it is no longer a definition, but instead a redundant redeclaration, which is deprecated. Here, the member stX::i
is implicitly inline. P0386R2
What C library headers were deprecated in C++ 17?
Some of the headers of the “C library” (this is the term for a part of the C++ standard library, not a part of the C standard!) were deprecated in C++17. These are; <ccomplex>
, <cstdalign>
, <cstdbool>
, <ctgmath>
. Note that the header <ciso646>
is not deprecated.
Old library parts were deprecated in C++ 17
Some of the library components in C++17 were deprecated in C++17. Deprecated library features are:allocator<void>
, raw_storage_iterator
, get_temporary_buffer
, is_literal_type
, std::iterator
. P0174R2
The <codecvt> was completely deprecated in C++ 17
The entire header <codecvt>
was deprecated in C++17 (there were no codecvt
class), as are the utilities wstring_convert
and wbuffer_convert
. These features found hard to use correctly, and there were doubts whether they are even specified correctly. Instead of these, it is recommended that developers should use dedicated text-processing libraries. P0618R0
The memory_order_consume temporarily deprecated in C++ 17
The semantics of “consume” ordering in C++14 have been found inadequate, and they think that the ordering needs to be redefined. Developers are encouraged to not use this ordering and instead they suggest using “acquire” ordering, so as to not be exposed to a breaking change in the future. P0371R1
The shared_ptr::unique was deprecated in C++ 17
The shared_ptr::unique
member function suggests behavior that is not actually provided; thus, it was deprecated. P0521R0
The result_of is deprecated in C++ 17
The result_of is deprecated and suggested to use the new trait invoke_result
instead. P0604R0
C++ Builder is the easiest and fastest C and C++ compiler and IDE for building simple or professional applications on the Windows operating system. It is also easy for beginners to learn with its wide range of samples, tutorials, help files, and LSP support for code. RAD Studio’s C++ Builder version comes with the award-winning VCL framework for high-performance native Windows apps and the powerful FireMonkey (FMX) framework for UIs.
There is a free C++ Builder Community Edition for students, beginners, and startups; it can be downloaded from here. For professional developers, there are Professional, Architect, or Enterprise versions of C++ Builder and there is a trial version you can download from here.