Go back to Richel Bilderbeek's homepage.
Go back to Richel Bilderbeek's C++ page.
Halve is a container code snippet to replace all values in a container by their halves (that is: x/2.0).
There are multiple ways to perform Halve:
#include <algorithm> |
This way is used as an answer in Exercise #9: No for-loops.
#include <vector> |
Prefer algorithms over loops [1,2].
#include <vector> |
Go back to Richel Bilderbeek's C++ page.
Go back to Richel Bilderbeek's homepage.