I am dealing with some legacy C structures - where we have zero length array. I think it is not valid, but we have to live with it. I was writing a macro, and I want to decay array to pointer type using std::decay.
But if I have a zero length array -
struct data {
key[0]; <<
};
std::decay<decltype(data::key)>
doesnt decay to pointer type. I am using this as a function return type, and it complains -
GCC Error:
error: ‘function’ declared as function returning an array
It works fine if its an array of length >= 1