Zero array warning for array of length 1

I have this code:

template<char... c>
struct StaticStringConst
{
    const char cstr[] = {c...,0};
};

      

Compiling under g ++ 5.1.0 I am getting the following error:

warning: ISO C++ forbids zero-size array 'cstr' [-Wpedantic]

      

It seems to me that my array is actually never zero ... so what's going on here?

+3


source to share





All Articles