The quality of the compiler and libraries can greatly affect the speed of the resulting code, but there's a lot you can do to help. Read about the available optimiser options. They do, however, make things more difficult for debuggers and compilers. The Standard Template Library, for example, avoids virtual functions for performance reasons.
Inlined routines are faster, but they'll bloat the code.
Note that a member function defined in the class declaration is automatically inline. In particular, note that an inline destructor can be inserted at each exit point of a function. Though Standard Library algorithms like reverse work on both list and vector containers, the choice of container is still important for performance. Though vectors can grow, it's more efficient to create them with their maximum size. Try to create and initialise a variable in one operation.