Logo

Programming-Idioms

This language bar is your friend. Select your favorite languages!
  • Rust

Idiom #314 Fill array with value

Set all the elements in the array x to the same value v

x.fill(v);

v must implement Clone.
#include <array>
x.fill(v);

New implementation...