Selection Sort implementation using modern C++ I have written this code for Selection sort. I want to use more C++11, C++14 or C++17. Please sugest some better alternatives.

#include &lt;iostream&gt;
#include &lt;vector&gt;
#include &lt;algorithm&gt;
#include &lt;iterator&gt;

template &lt;typename InputItr&gt;
void selectionSort(InputItr first, InputItr last)
{
  while(first != last)
  {
    InputItr min = std::min_element(first, last);
    if(*min &lt; *first)
    {
      std::swap(*min, *first);
    }
    ++first;
  }
}

template &lt;typename Itr&gt;
void print(Itr first, Itr last)
{
  while(first != last)
  {
    std::cout &lt;&lt; *first &lt;&lt;" ";
    ++first;
  }
  std::cout &lt;&lt; "\n";
}

int main()
{
  std::vector&lt;int&gt; v({5, 3, 12, 2, 8});
  std::cout &lt;&lt; "Original Array :";
  print(v.begin(), v.end());
  selectionSort(v.begin(), v.end());
  std::cout &lt;&lt;"Sorted Array :";
  print(v.begin(), v.end());
  std::cout &lt;&lt; '\n';

  std::vector&lt;char&gt; c({'t', 'q', 'a', 'r', 'p'});
  std::cout &lt;&lt; "Original Array :";
  print(c.begin(), c.end());
  selectionSort(c.begin(), c.end());
  std::cout &lt;&lt;"Sorted Array :";
  print(c.begin(), c.end());
  std::cout &lt;&lt; '\n';

  std::vector&lt;std::string&gt; str({"code", "live", "love", "sing", "create"});
  std::cout &lt;&lt; "Original Array :";
  print(str.begin(), str.end());
  selectionSort(str.begin(), str.end());
  std::cout &lt;&lt;"Sorted Array :";
  print(str.begin(), str.end());
  std::cout &lt;&lt; '\n';

}
InputItr doesn't appropriately describe the iterator requirement of your selection sort, which multi-passes the range.  Consider naming the type after forward iterator.
Allow for custom overloads of swap by calling swap in an unqualified context.

    using std::swap;
    swap(*min, *first);


which is just std::iter_swap

    std::iter_swap(min, first);

You don't need to conditionally check if min is smaller than first.  Just swap.

  for (; first != last; ++first) {
    auto min = std::min_element(first, last);
    std::iter_swap(min, first);
  } 

Your print function is just a reimplementation of std::copy.
Make sure you include everything (missing &lt;string&gt;).
Assert liberally. See the CPPCoreGuidelines.