Existing C++ Features Removed

Existing C++ Features Removed

First of all, I list down the removed or omitted features from the latest version as compared to previous one.

The draft for the C++17 comprises now 1586 pages because of compatibility requirements. A comparison chart is mentioned below:

C++ 17 - Page Count of Specs

The new features are added and fortunately, there are certain things that could go away.
1.      Removal of Trigraphs

Trigraphs are special character sequences. These characters are used when system doesn’t support 7 bit ASCII code – just like in ISO 646-character set. For example ??- produces ~ and ??= generates #. It is important to mention that all basic source character set of C++ fits in 7-bit ASCII.

But the point of discussion is that, these sequences were rarely used. Hence, they are omitted in the current version. The removal of these sequences will make the translation phase simpler.
2.      Removal of Registers

The keyword “register” was deprecated in the C++11 standard because it has no meaning. But now in C++17 it has been removed. Although, this keyword is still reserved and may be reused in the future revisions.
3.      Removal of Deprecated Operator ++

Increment (++) postfix and prefix expressions are no longer valid for bool operands. This operator is denounced for a very long time. During launch of C++98, it was decided better not to use it. But finally, in C++17, the committee has agreed to remove this operator from the language.
4.      Removal of Deprecated Exception Specifications

In C++17, the exception specification is a part of the type system. But still the standard comprises old and deprecated exception specification, which appears to be not practical and in use.

For example:

1
2
3
4
5
6
7
8
9
    
void fooThrowsInteger(int x) throw(int)
{  
   printf_s("throw int\n");  
 
 if (x == 0)
   {
      throw 1;  
   }
}  

The above-mentioned code is deprecated since 2011. Only the method “throw()” remains as a synonym for “noexcept()” since C++11.
5.      Removal of auto_ptr

The C++11 provides us with smart pointers like shared_ptr, weak_ptr and unique_ptr. Comparatively, auto_ptr was old and buggy thing in the language, so it was deprecated in C++11 however it is finally removed from C++ 17. Almost all features that have been deprecated in C++11 and replaced by superior components, are now no longer included. Although their names are still reserved however the implementations might choose to continue to use these features in future.
Posted on by