
Welcome Back to C++ (Modern C++) - dzderic
http://msdn.microsoft.com/en-us/library/hh279654.aspx
======
jussij
The old (STL based) C++ looks like this:

    
    
        // circle and shape are user-defined types
        circle* p = new circle( 42 ); 
        vector<shape*> v = load_shapes();
        
        for( vector<circle*>::iterator i = v.begin(); i != v.end(); ++i ) {
            if( *i && **i == *p )
                cout << **i << “ is a match\n”;
        }
        
        for( vector<circle*>::iterator i = v.begin();
                i != v.end(); ++i ) {
            delete *i; // not exception safe
        }
        
        delete p;
    

The new modern C++ looks like this:

    
    
        #include <memory>
        #include <vector>
        // ...
        // circle and shape are user-defined types
        auto p = make_shared<circle>( 42 );
        vector<shared_ptr<shape>> v = load_shapes();
        
        for_each( begin(v), end(v), [&]( const shared_ptr<shape>& s ) {
            if( s && *s == *p )
                cout << *s << " is a match\n";
        } );
    

To be honest, as a C++ programmer who dates back to the days of Turbo C++
(i.e. before the days of STL), I can honestly say I no longer have any time
for the old or new STL based C++.

The modern day C++ language is just too full of noise!

To remain relevant C++ needs to try to become a nice, easy to use language
without the massive level of noise.

To be honest, as a 10 year+ veteran of C++, I have to say I don't miss it one
bit.

~~~
RotsiserMho
That's not modern C++. This is much less noisy:

    
    
        #include <memory>
        #include <vector>
        // ...
        // circle and shape are user-defined types
        auto p = make_shared<circle>( 42 );
        auto shapes = load_shapes();
        
        for (auto s : shapes) {
            if( s && *s == *p )
                cout << *s << " is a match\n";
        }
    

Not sure what MS is thinking.

~~~
alok-g
I guess a next feature would be auto auto (i.e., do not have to write auto).
:-)

------
wglb
_The language is more flexible than other languages because you can use it to
create a wide range of apps_

As someone who uses Lisp as well as C++, i disagree.

~~~
deeviant
Care to expound why you disagree? Or was there some poll I was unaware of in
which you were responding to?

~~~
wglb
I was responding to the first or second sentence in the article, which I
quoted.

Lisp, and many other languages, including functional, in my belief, are more
powerful than C++.

~~~
deeviant
Why are they more powerful?

