In addition to 'var' (see my other post here), one of the things I really like about C# is that I can both declare, then initialize members of a class using braces, like this...
var reallyLongFooVarName = new ReallyLongFooClassName(){
Name = "I'm an instance of Foo",
ID = 23 };
or even on one line, like this...
var longFooVarName = new ReallyLongFooClassName(){ Name = "I'm an instance of Foo", ID = 23 };
This creates an instance of ReallyLongFooClassName and then sets its members 'Name' and 'ID'.
This compiles to the same thing as if you typed this...
ReallyLongFooClassName reallyLongFooVarName = new ReallyLongFooClassName();
reallyLongFooVarName.Name = "I'm an instance of Foo";
reallyLongFooVarName.ID = 23;
So does Objective-C/C++ have anything equivalent to the member-brace-initialization of C#?
Note: Thanks to my other post, I already know that 'auto' is the 'var' equivalent in Objective-C++ but Objective-C doesn't have any such equal, which is a shame. Again, see my other post here for more info.)
Update
I'm aware of writing initializers. That is a different beat altogether. The technique I demoed above In C# uses the setters of the properties, or sets the member variables directly without having to write a constructor (their sort-of-equivalent to Objective-C's 'init' members.) Having to write init members forces you to have to pre-specify what you want to set. Member brace-initialization lets you specify any combination of properties/member variables and in any order you want. Again, it's just syntactic sugar for writing multiple lines of code at once. It doesn't actually change the class.