How do I reverse a C++ vector?
There’s a function std::reverse in the algorithm header for this purpose.
There’s a function std::reverse in the algorithm header for this purpose.
You can use std::find from <algorithm>: This returns a bool (true if present, false otherwise). With your example:
This is not related to performance at all. But consider this: you are using two libraries called Foo and Bar: Everything works fine, and you can call Blah() from Foo and Quux() from Bar without problems. But one day you upgrade to a new version of Foo 2.0, which now offers a function called Quux(). … Read more