RAD Studio |  |

C++0x Features (C++Builder 2009)
Collapse All

C++Builder 2009 implements a number of the new features proposed in the C++0x standard. This section lists and describes these C++0x features. You can view the Working Paper draft that was used to guide the implementation of these features at Draft Working Paper. You can view a summary of the working group papers at Summary of Working Group Papers.

Topics

Name | Description
alignof Operator (C++0x) | The C++0x standard includes the alignof keyword and operator, which tells you the alignment of a type. To get the alignment of a type, use the following syntax:
Type Trait Functions (C++0x) | This section contains Type Trait Functions help topics.
Attributes noreturn and final (C++0x) | The C++0x standard includes the addition of attributes that might be applied to the declaration of a class, a general function, a constructor, an array, and so forth. C++Builder 2009 implements two attributes: noreturn and final. Attributes are set off in the code by double brackets, such as [[noreturn]].
Explicit Conversion Operators (C++0x) | C++Builder 2009 includes support for explicit conversion operators, one of the features in the C++0x standard. You can now apply the function specifier explicit in the definition of a user-defined conversion operator. Previously, explicit constructors (including copy constructors) were added to the language in order to prevent unintended conversions being implicitly called by the compiler. Now explicit conversion operators have been added to provide the same control over unintended conversion calls. . Conversion functions declared as explicit work in the same contexts as explicit constructors (that is, direct-initialization, explicit type conversion). Explicit conversion operators produce compiler diagnostics in the same... more
extern Templates (C++0x) | C++Builder 2009 includes the use of extern templates, which allow you to define templates that are not instantiated in a translation unit. Using extern templates thus reduces both compilation time and the size of the compiled module. This feature is part of the new C++0x standard.
Forward Declaration of Enums (C++0x) | C++Builder 2009 introduces forward declaration of enums. You can declare an enumeration without providing a list of enumerators. Such declarations would not be definitions and can be provided only for enumerations with fixed underlying types. An enumeration can then be re-declared, possibly providing the missing list of enumerators, but the re-declaration must match the previous declaration. This feature is one of the C++0x features added to C++Builder 2009.
rvalue References (C++0x) | C++Builder 2009 includes the use of rvalue references, which allow creating a reference to temporaries. Also, rvalue references avoid unnecessary copying and make possible perfect forwarding functions. This feature is one of the C++0x features.
Static Assertions (C++0x) | The static_assert keyword is used to test assertions at compile time. This is one of the C++0x features added to C++Builder 2009. This keyword operates differently than the macro assert, which raises assertions at run time. The keyword static_assert also differs from the preprocessor directive #error, which operates during preprocessing and simply emits a message.
Strongly Typed Enums (C++0x) | C++Builder 2009 introduces scoped enums. In addition, existing enums are extended with underlying type and explicit scoping. This feature is one of the C++0x features added to C++Builder 2009. Scoped enums are generally characterized as follows: Enumerators are in the scope of their enum. Enumerators and enums do not implicitly convert to int (as do "plain" enumerators and enums). Enums and their enumerators can have a defined underlying type.
Type Specifier decltype (C++0x) | The C++0x standard includes the decltype keyword and operator, which represents the type of an expression. This feature is one of the C++0x features added to C++Builder 2009.
Unicode Character Types and Literals (C++0x) | C++Builder 2009 implements new character types and character literals for Unicode. These types are among the C++0x features added to C++Builder 2009.

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!