C++ Standard update

Overview: C++ Gets an Overhaul

As I’m new, most of that is right over my head. What I do get out of it is they’re going to be adopting a lot of the Boost libraries. Little surprise there as I read a lot about the Boost libraries.

Here is one part that show how new I am to C++:

C++0x also removes some embarrassments from the language. For example, C++03 has at least three different forms of initialization:

1
2
3
int x=0;
int x(0);
int y[2]={1,2};

C++0x defines a unified initialization notation which can even be used in the declaration of dynamically allocated arrays:

1
2
3
4
5
6
7
8
int* a = new int[4] {1, 10, 20,95 };
vector<string> vs={"ab","cd","ef"};
 
class S {
 int arr[3];
public:
  S() : arr{ 1, 2, 3 } {}
};

I knew about the syntax for the first two in the list but had not seen the third or had seen it described differently. The last code block looks a little alien to me. Perhaps that’s just because my exposure to C++ classes is so limited.

Either way, this is definitely a month for change in the C++ world:

The vast number of new features forces the committee to work at an incredible speed. A clear statement of intent was made to complete work on the new standard at the San Francisco meeting of September 2008 in order to achieve publication in 2009.

This entry was posted in Programming and tagged . Bookmark the permalink.

Leave a Reply