tags:

views:

510

answers:

9

Most of the compilers already support C++0x. Have you started using C++0x or are you waiting for the definition of x? I have to do some refactoring of my code; should I start using the new features?

+3  A: 

I would hold off on writing production code until '0x+y, where y is when they work the bugs out of the compiler and bring it into standard complience (whatever the standard may be).

But for development? I use it for playing around, writing project euler, etc. I use it on presentations and newsgroups as well.

Todd Gardner
+8  A: 

C++0x is not a completed standard yet. It's likely that there will be many revisions before an international accepted standard is released. So it all depends, what are you writing code for? If it's for an work-assignment i would stick with regular C++, wait for the standard to be set and give the programming community the time it takes to adjust. Don't refactor code you really need to implement, it might give you a loot of trouble.

I however think C++0x great to play around with and also it can't hurt to be familiar with the syntax when 0x is globally accepted.

Silfverstrom
The plan is for the standard to be released around the end of this year, and there's not expected to be many revisions. They've already got a draft out, and it has been revised once or twice. Later this year, they're going to put it to a vote in ISO, and it is expected to pass there without any problems.
jalf
+1  A: 

I will start using it when Visual Studio FULLY supports it. Right now VS10 only supports a few features.

rlbond
I also thought that way. But to wait for fully implementation could take a good time (My opinion is that this will take years and maybe there will be some minor seldomly used features that will never be implemented in some compilers!). So I will use all features that are available in all compilers involved. (Unfourtunatly we have to use GCC 3.4.5 for our embedded development :-((( )
rstevens
+4  A: 

I've started using nullptr, using #define nullptr 0 for those compilers (i.e. most) that don't support it yet.

James Hopkin
+1: I'm currently thinking of doing the same.
rstevens
Doing the same.
Shmoopty
+1  A: 

We are still in the process of switching from VS6 to VS 2005. We probably wont be using exclusively C++0x compilers for new work until late 201x.

T.E.D.
+4  A: 

From the link you have provided, it looks like you actually mean TR1, not really C++0x. And yes, I am using most of the new TR1 libraries for quite some time, because many of them are former Boost libraries.

And I can only encourage everyone to use them as well.

beef2k
+3  A: 

There are very few compilers that support something. Actually VS supports only TR1 libraries, gcc supports some features like variadic templatres, rvalue, auto and some more. Intel compiler has some.

I mostly started using variadic templates like:

#ifdef HAvE_VARIADIC
template<typename... Args>
void format(std::string,Args... args);
#else
template<typename T1>
void format(std::string,T1 p1);
template<typename T1,typename T2,>
void format(std::string,T1 p1,T2 p2);
...
template<typename T1,typename T2,...,typename T10>
void format(std::string,T1 p1,T2 p2,..., T10 p10);
#endif
Artyom
+2  A: 

We have played with c++0x a lot and now when gcc supports some of the features we will use them as soon as they are available. The reason is simple - with auto keyword you save a lot of typing, with rvalue references you get performance gains and with initializer lists and variadic templates less typing and much more readable code.

Actually the major goals of c++0x standard are our goals too, because we will have advantage to our competitors with these features. That's why we are going to use them without waiting at all. Of course if you need multi platform compatibility, this step is not acceptable. In case you don't care about it, use it immediately and you can only win.

Gramic
+1  A: 

Yes I'm already using C++0x and releasing open source libraries and code. All of my future C++ open source projects will be written in this variant. After using variadic template parameters and decltype/auto I can't go back!

tuxjay