• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

c++0x is (finally) finalized

http://cplusplus-soup.com/2011/03/28/c0x-will-be-c-2011/

Wow, that took long enough.

I'm actually looking forward to the auto variable type. Looks like it could be pretty useful for the lazy (especially when using iterators).

That, and the thread library is pretty interesting to me.

Ugh, the variant. While it can be used properly by good coders who don't make assumptions about data, I've had to fix enough shoddy code with bugs introduced by weakly typed variables for a lifetime.
 
Ugh, the variant. While it can be used properly by good coders who don't make assumptions about data, I've had to fix enough shoddy code with bugs introduced by weakly typed variables for a lifetime.

Boy do I ever agree with this statement.

I don't mind...

var myList = new List<something>();

I do mind...

var myThingy = ReturnSomethingCompletelyUnknown();

Thank the lord for intellisense.
 
Ugh, the variant. While it can be used properly by good coders who don't make assumptions about data, I've had to fix enough shoddy code with bugs introduced by weakly typed variables for a lifetime.

No. Auto is not a variant!

Auto is a fixed strong-type - however, it avoids the programmer having to specify the type in those cases where the type can be determined by the compiler.

e.g.
Code:
string [] mystrings = GetListOfStrings();
auto name = mystrings[0];

name = 1.0f;

will be pre-processed to
Code:
string [] mystrings = GetListOfStrings();

string name = mystrings[0];
name = 1.0f;

while will fail to compile because a float cannot be assigned to a strongly-typed string.
 
Boy do I ever agree with this statement.

I don't mind...

var myList = new List<something>();

I do mind...

var myThingy = ReturnSomethingCompletelyUnknown();

Thank the lord for intellisense.

What it avoids (which I think is a good thing) is instead of typing something like

SuperLongNamespace::SuperLongClassName::SuperLongClassType varname = SuperLongClassName::function();

It doesn't allow variable type reassigning. Still strongly typed, just now you don't have to know the exact type you are assigning.
 
What it avoids (which I think is a good thing) is instead of typing something like

SuperLongNamespace::SuperLongClassName::SuperLongClassType varname = SuperLongClassName::function();

It doesn't allow variable type reassigning. Still strongly typed, just now you don't have to know the exact type you are assigning.

Agreed. All I'm saying is that I like to be able to read a declaration and know the type of the thing being declared, without having to navigate to a method definition or hover for the signature to see what it returns.
 
Agreed. All I'm saying is that I like to be able to read a declaration and know the type of the thing being declared, without having to navigate to a method definition or hover for the signature to see what it returns.

True. And I guess it could add some confusion to what is going on since you have to be somewhat familiar with the code to know what is going on with different variables.

I wonder, could you do this

Code:
auto function(auto vara, auto varb)
{
   return vara + varb;
}

Because, honestly, that would eliminate most of the uses of templates.
 
True. And I guess it could add some confusion to what is going on since you have to be somewhat familiar with the code to know what is going on with different variables.

I guess I don't see the benefit. It may save a few keystrokes, but I prefer explicit code. Ambiguity makes for maintenance nightmares.

Also, I could see it causing issues with derived classes that may look similar due to usage at a glance, but have different functionality. I suppose I just have PTSD brought on by years of fixing horrible code by lazy programmers.
 
Last edited:
True. And I guess it could add some confusion to what is going on since you have to be somewhat familiar with the code to know what is going on with different variables.

I wonder, could you do this

Code:
auto function(auto vara, auto varb)
{
   return vara + varb;
}

Because, honestly, that would eliminate most of the uses of templates.
Auto can't be a return type or a parameter type
 
Doesn't most of this stuff come from interoperability stories? Variants and IDispatch based interfaces came about to support scripting (typeless) clients. If you're not supporting that, you never need to deal with it.

Sort of like why would you do COM if you owned all the endpoints of an app. Think masturbating with a cheese grater... slightly amusing but mostly just painful.

If it's not a variant, then it's dynamic is the way I read it.
 
Back
Top