Insertion Sort and Selection Sort Implementation I wanted to practice using templates since I have no experience with them, so I implemented these sorting algorithms. 

Selection Sort:

template&lt;typename Container&gt;
void selectionSort(Container&amp; numbers)
{
    for (auto iter = std::begin(numbers), iterEnd = std::end(numbers); iter != iterEnd; ++iter)
    {
        auto minNum = minIndex(numbers, iter, iterEnd);

        std::swap(*iter, *minNum);
    }
}

template&lt;typename Container, typename Iter&gt;
Iter minIndex(const Container&amp; numbers, Iter start, Iter end)
{
    Iter minIdx = start;
    auto minNum = *start;

    while (++start != end)
    {
        if (*start &lt; minNum)
        {
            minNum = *start;
            minIdx = start;
        }
    }
    return minIdx;
}


Insertion Sort:

template&lt;typename Container&gt;
void insertionSort(Container&amp; numbers)
{
    for (auto iter = std::begin(numbers) + 1, iterEnd = std::end(numbers); iter != iterEnd; ++iter)
    {
        if (*iter &lt; *(iter-1))
        {
            resort(numbers, iter);
        }
    }
}
template&lt;typename Container, typename Iter&gt;
void resort(Container&amp; numbers, Iter containerIter)
{
    auto temp = *containerIter;

    while (containerIter != std::begin(numbers) &amp;&amp; temp &lt; *(containerIter-1))
    {
        *containerIter = *(containerIter - 1);
        --containerIter;
    }

    *containerIter = temp;
}
First tip: use more aggressive warnings, this way you would be warned by the compiler about passing unused parameters into functions, that is you would automatically made:

template&lt;typename Iter&gt;
Iter minIndex(Iter start, Iter end)


Another thing would be, to write your algorithms in similar way as the standard ones. That is avoid passing the reference to the container, but rather pass iterators into it. So your sort functions should look similarly to:

&lt;typename InputIt&gt;
void someSort (InputIt first, InputIt last)


This will e.g. allow you to sort specific parts of your container with no extra effort.