Hacker News new | ask | show | jobs
by RotsiserMho 4280 days ago
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.
1 comments

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