Working a bit with javascript, I realized that it’s faster to develop compared to C++, which slows down the recording for reasons that are often not applied. It is not always convenient to go through .begin()and .end()that happen through my entire application.
I am thinking of an extension std::vector(more encapsulation than inheritance) that can basically follow the conventions of methods javascriptlike
.filter([](int i){return i>=0;})
.indexOf(txt2)
.join(delim)
.reverse()
instead
auto it = std::copy_if (foo.begin(), foo.end(), std::back_inserter(bar), [](int i){return i>=0;} );
ptrdiff_t pos = find(Names.begin(), Names.end(), old_name_) - Names.begin();
copy(elems.begin(), elems.end(), ostream_iterator<string>(s, delim));
std::reverse(a.begin(), a.end());
But I was wondering if this is a good idea, why is there no longer a library C++for such ordinary daily functions? Is there something wrong with this idea?
source
share