C++C++14C++17C++20Learn C++

What Are The Deprecated C++14 Features In C++17?

What Are The Deprecated C++14 Features In C++17

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.

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_typestd::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

What Are The Deprecated C++14 Features In C++17 C++ logo

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.

Oh hi there 👋
It’s nice to meet you.

Sign up to receive awesome C++ content in your inbox, every day.

We don’t spam! Read our privacy policy for more info.

About author

Dr. Yilmaz Yoru has 35+ years of coding with more than 30+ programming languages, mostly C++ on Windows, Android, Mac-OS, iOS, Linux, and some other operating systems. He graduated and received his MSc and PhD degrees from the Department of Mechanical Engineering of Eskisehir Osmangazi University. He is the founder and CEO of ESENJA LLC Company. His interests are Programming, Thermodynamics, Fluid Mechanics, Artificial Intelligence, 2D & 3D Designs, and high-end innovations.
Related posts
C++C++11C++14C++17C++20Introduction to C++Learn C++

Learn Copy Constructors in C++ Classes

C++C++11C++14C++17Introduction to C++Learn C++Syntax

Learn How To Use Types Of Destructors In C++?

C++C++11C++14Learn C++Syntax

How To Convert u32string To A wstring In C++

C++C++11C++14C++17C++20Introduction to C++Learn C++

How To Learn The Move Constructors In Modern C++?