You are doing it wrong on many levels. The syntax you use does not do what you think. You are now initializing the 17th element of the table to 0.
In your case, memset is probably the fastest and easiest. However, this will not work for complex types, so I would like to write a simple snippet for a general example, for example:
template<typename T> inline void zero_init(T array[], size_t elements){ if( std::is_pod<T>() ) memset(array, 0, sizeof(T)*elements); else std::fill(begin(array), begin(array)+elements, 0); }
This will check if the type is a POD type, which in this context means that it can be initialized with memset and will put 0 for the whole table. If T does not support it, then for each element the equivalent of element = 0 will be called. Also, the check can be evaluated at compile time, so if is most likely, if will be compiled, and for each type a simple version with one layer will be created at compile time.
You can call through:
Cache::Cache() { zero_init(byte, 16); }
source share