Consider this simple program:
vector foo = {0, 42, 0, 42, 0, 42}; replace(begin(foo), end(foo), foo.front(), 13); for(const auto& i : foo) co
A solution could be as follows (even though you are making a temporary)
template void replace_value_of_first(std::vector& v, const T& value) { std::replace(v.begin(), v.end(), T(v.front()), value); }