C++ 0x - Future of C++

C++ 0x will be probably C++ 09 when the ISO standard of the language will be defined in its new version. The new C++ language will be extended, as has announced Bjarne Stroustrup, its creator, according to three levels:

  1. Language.
  2. Standard library.
  3. Concurrency.

Language

The semantics essentially will be improved, mainly types and security provided by controls on the types, but new control structures will also appear.
The internal UTF-8 format will be supported for strings.

New types and keywords

  1. auto
    Type of variable deduced from what is assigned. Example:
    vector <string> v = ( "Alicia", "Bea", "Clara", "Dara"); 
    for (auto x: v) cout "x" '\ n';
  2. constexpr
    A constant expression.
  3. nullptr
    A name for a null pointer.
  4. raw string
    String where escape codes are not interpreted, as in PHP with single quotes.
  5. decltype
    How to use the type of an expression, returns the type and modifiers of any object including a function.

Controls

  1. Control of alignment of values.
  2. Control of defaults.

New constructs

For loop over an interval.
As it is implemented on most scripting languages.

Lambda function.
Functions defined in place for a contextual use.

rvalue.
This is a reference to the contents of a variable, where the A variable is assigned the content of B without a copy but by moving the pointer on the new content, in the perspective where B is no longer used.

Variadic template.
Template whose number of arguments is variable.

Static assertion.
Introduced with the keyword static_assert, it tests the validity of an assertion at compile-time.

Typed enum with scope.

Concepts.
One way to define abstract arguments to templates.

Classes

Delegating and inheriting constructors.
Attributes of classes may be assigned directly in the definition of the class.

Standard library

New object will appear that already became familiar in scripting languages such as PHP.

  1. regexp
    Regular Expressions.
  2. tuple
    Used in the Python language.
  3. Array
    Static array.
  4. unordered_map
    Hash table.
  5. Date.
  6. Smart pointer.

And many various components of libraries and improvements. For example, now you can assign a static list to a vector at its declaration.

Concurrency

Specialists in system programming and multi-tasking will understand. For others, including webmasters, it should be noted asynchronous that became familiar with Ajax.

  1. Memory model adapted to today's computers with multi-core processors.
  2. Threading ABI.
  3. Atomic types.
  4. Mutexes and locks.
  5. Thread local storage.
  6. Exchanging messages asynchronously.

What is lucky to come

A garbage collector.
An automatic memory manager. It will be optional, some applications do not need and do not use it.

Modules (in the sense of Python where the semantics of language can be extended when it incorporates a library).

Dynamic arrays or bound control.
It has already an equivalent in the current library with the vector class.

Conclusion

In version 09 the C++ language will gets many facilities inherited from other programming languages and from Java, but it remains complex, and even more complex with the development of generic templates and remains a language suitable for system development.

To quote the author "the ugly and illogical C syntax" is still the best way to make system programming (compilers, operating systems, drivers, etc.).

Reference

DevX C++ and Bjarne Stroustrup.

Programming languages AspectJ - Basic - C - C++ - C# - Eiffel - Go - Java - JavaScript - JavaFX - Pascal - PHP - Python - Rexx - Ruby - Scala - Scriptol - Tcl - HTML - XML - XAML - XUL - SQL

(c) 2008-2009 Scriptol.com