I came across the template version _snwprintf_s
from MSDN:
template <size_t size>
int _snwprintf_s(
wchar_t (&buffer)[size],
size_t count,
const wchar_t *format [,
argument] ...
); // C++ only
I understand how to use it, and I'm familiar with c++ templates and the possibility to use templates with an integer.
What is the type of wchar_t (&buffer)[size]
? Is it a reference to a wchar_t, if so then what the [size] mean? what is this called?
I'm guessing the compiler infers the size somehow but this is the first time I've come across such syntax and would appreciate an explanation as I haven't found anything on it by myself (probably since I don't know what to search for).
Also, If you can explain how this works behind the scene, that'd be great.
EDIT:
I'm more interested at how this works compiler-wise, less about the type that is passed, which is as mentioned explained here
Thanks