How to remove vector elements in a loop?

How to remove vector elements in a loop?

Have you ever wondered how you could delete vector elements in C++ in a loop? This is a way to do it... 

C++ tip 16: References are Aliases, not Pointers

C++ tip 16: References are Aliases, not Pointers

Don't confuse references for pointers. References are another name for an object which currently exist. They are not Pointers.

C++ tip 15: Delay construction of objects until they are needed

C++ tip 15: Delay construction of objects until they are needed

Don't call an object constructor unless you are sure you will use it. Delay its construction as much as possible.

C++ tip 14: Don't return a reference when you must return an object

C++ tip 14: Don't return a reference when you must return an object

Learn when you should you return an object itself and not a reference to an object. 

C++ tip 13: Prefer pass-by-reference-to-const to pass-by-value

C++ tip 13: Prefer pass-by-reference-to-const to pass-by-value

Learn how to avoid unnecessary constructors/destructors calls and how to fix the slicing problem by passing-by-reference-to-const instead of passing-by-value.