Hacker News new | past | comments | ask | show | jobs | submit login

To be honest, if that's the notation, i will not be very eager to jump on cpp23. That said, I admire people who's minds stay open for c++ improvements and make that effort.



Well you could write it as

    to<vector>(items | filter(shouldInclude) | transform(f))
if you really want to, but generally C++ programmers prefer to be explicit and include the namespaces.


>but generally C++ programmers prefer to be explicit and include the namespaces.

why, though? Collisions in the stdlib? stdlib is too new to not be the default for these names?


The using declaration modifies your namespace.

From the docs:

    namespace X
    {
        using ::f;        // global f is now visible as ::X::f
        using A::g;       // A::g is now visible as ::X::g
    }
 
    void h()
    {
        X::f(); // calls ::f
        X::g(); // calls A::g
    }
Link to docs: https://en.cppreference.com/w/cpp/language/namespace#Using-d...


Thanks




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: