/*
As for the scope guards, they're not like totally try catch finally (and find me 'finally' in C++ ... ). You can read more here: http://www.digitalmars.com/d/exception-safe.html
*/
D does not have any big killer, but rather dozens of small improvements that, when combined, make programming much easier.
1. Slicing
char[] foo = "foo bar";char[] bar = foo[4 .. $];// bar == "bar"
2. Associative arrays
int[char[]] myMap;myMap["foo"] = 1;myMap["bar"] = 2;myMap["baz"] = 3;writefln(myMap["bar"]);// prints '2'
3. Delegates
class Foo { this (int a) { this.a = a; } void foo() { writefln(a); } int a;}void main() { auto dg = &(new Foo(5)).foo; dg(); // prints '5'}
4. Automatic type inference (Like in the previous example)
auto x = 2 + 3.4f;writefln(typeid(typeof(x)));// prints 'float'
5. static if
template fact(int a) { static if (0 == a) { const int fact = 1; } else { const int fact = a * fact!(a - 1); }}void main() { writefln(fact!(4)); // prints '24'}
6. Nested functions
void main() { void foo() { writefln("Yo !"); } foo();}
7. Function and delegate literals
void foo(int delegate() x) { writefln(x());}void main() { int someInt = 123; foo( { return someInt; } );}
8. Typesafe varargs
void main() { void foo(int[] arr ...) { writefln(arr); } foo(1, 2); // prints '[1,2]' foo(3); // prints '[3]'}
9. Array bounds checking (can be disabled)
int[] arr = new int[3];arr[10] = 4; // runtime exception with line number
10. String switches
switch ("foo") { case "bar": writefln(1); break; case "foo": writefln(2); break; // that's the case :P}
11. Painless static initialization
class Foo { int a = 5; int b = 3; typedef int Bar = 10; Bar c; // initialized to 10}
etc etc etc ...
Yes, many of these can be accomplished in C++ thru the use of [insert your favourite hack name here] or Boost, but I wouldn't call them clean solutions
Most of it is syntactic sugar of some sort, but then any language would be syntactic sugar for asm.