Well, for char arrays GCC has this:
Code:
// Specialization: for one-byte types we can use memset.
inline void
fill(unsigned char* __first, unsigned char* __last, const unsigned char& __c)
{
__glibcxx_requires_valid_range(__first, __last);
const unsigned char __tmp = __c;
std::memset(__first, __tmp, __last - __first);
}
inline void
fill(signed char* __first, signed char* __last, const signed char& __c)
{
__glibcxx_requires_valid_range(__first, __last);
const signed char __tmp = __c;
std::memset(__first, static_cast<unsigned char>(__tmp), __last - __first);
}
inline void
fill(char* __first, char* __last, const char& __c)
{
__glibcxx_requires_valid_range(__first, __last);
const char __tmp = __c;
std::memset(__first, static_cast<unsigned char>(__tmp), __last - __first);
}
But indeed = {0} is the way to fill an array with all zero values.