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
vector foo = {0, 42, 0, 42, 0, 42}; replace(begin(foo), end(foo), static_cast(foo.front()), 13); assert(equal(begin(foo), end(foo), begin({13, 42, 13, 42, 13, 42})));