Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is C++14 adding new keywords to C++?

The C++ Standards Committee tends to shy away from adding new keywords to the language, yet with C++11 that was not the case. Some examples:

constexpr decltype thread_local auto // New usage noexcept nullptr static_assert alignof alignas 

Are there any new keywords introduced with C++14?

like image 245
Nikos Athanasiou Avatar asked Aug 19 '14 10:08

Nikos Athanasiou


People also ask

What was added in C++14?

C++14 adds the decltype(auto) syntax. This allows auto declarations to use the decltype rules on the given expression. The decltype(auto) syntax can also be used with return type deduction, by using decltype(auto) syntax instead of auto for the function's return type deduction.

Does C have new keyword?

No, new and delete are not supported in C.

What is difference between C++ and C++14?

The major difference between C and C++ is that C is a procedural programming language and does not support classes and objects , while C++ is a combination of both procedural and object oriented programming language ; therefore C++ can be called a hybrid language.

How many keywords does C and C++ support?

Keywords in C++ are the collection of reserved words. These are written in lower cases and have a special meaning defined by the compiler. There are a total of 95 keywords in C++ and out of which around 30 keywords are not available in the C language.


1 Answers

Table 4 (Keywords) in N3936 (C++14):

alignas           continue          friend            register          true alignof           decltype          goto              reinterpret_cast  try asm               default           if                return            typedef auto              delete            inline            short             typeid bool              do                int               signed            typename break             double            long              sizeof            union case              dynamic_cast      mutable           static            unsigned catch             else              namespace         static_assert     using char              enum              new               static_cast       virtual char16_t          explicit          noexcept          struct            void char32_t          export            nullptr           switch            volatile class             extern            operator          template          wchar_t const             false             private           this              while constexpr         float             protected         thread_local const_cast        for               public            throw 

Table 4 in N3337 (C++11):

alignas           continue          friend            register          true alignof           decltype          goto              reinterpret_cast  try asm               default           if                return            typedef auto              delete            inline            short             typeid bool              do                int               signed            typename break             double            long              sizeof            union case              dynamic_cast      mutable           static            unsigned catch             else              namespace         static_assert     using char              enum              new               static_cast       virtual char16_t          explicit          noexcept          struct            void char32_t          export            nullptr           switch            volatile class             extern            operator          template          wchar_t const             false             private           this              while constexpr         float             protected         thread_local const_cast        for               public            throw 

...which is a long-winded way of saying "no".

(override and final are "identifiers with special meaning" and are listed in Table 3; and etc. are "alternative representations...for certain operators and punctuators" and are listed in Table 5. Neither table changed between C++11 and C++14.)

like image 176
T.C. Avatar answered Sep 24 '22 11:09

T.C.