I have been trying to substitute the macro that comes with the
compiler with the following template:
template <typename ITEM,size_t SIZE>
inline size_t arraySize(ITEM const (&array)[SIZE]) {
return SIZE;
}
AFAIK, it is compliant with the standard, and it should work.
In fact, it works perfectly on Borland C++ 2006, but it fails on GCC
3.4.1.
Should it work, from the Standard point of view, or am i missing
something?
Best regards,
Zara
compiler with the following template:
template <typename ITEM,size_t SIZE>
inline size_t arraySize(ITEM const (&array)[SIZE]) {
return SIZE;
}
AFAIK, it is compliant with the standard, and it should work.
In fact, it works perfectly on Borland C++ 2006, but it fails on GCC
3.4.1.
Should it work, from the Standard point of view, or am i missing
something?
Best regards,
Zara
Comment