This code fails to compile
template<unsigned n>
void test(char const (*)[n + 1]) { }
int main()
{
char const arr[] = "Hi";
test(&arr);
}
with error
note: candidate template ignored: couldn't infer template argument 'n'
However, if you change n + 1 to n, it compiles just fine.
Why can't the compiler deduce n when it has an offset added to it?