C++ Logo

std-proposals

Advanced search

Re: [std-proposals] auto[]

From: Данил Сидорук <danilsidoruknv_at_[hidden]>
Date: Tue, 16 Jul 2024 15:14:57 +0300
I got that we can't just remove `T shall not be an array type` and make few changes in the next paragraph. Cause we can't deduce array type using the rules of template argument deduction from a function call with initializer list:
 
#include <cstdio>
 
template <class U>
void f(U(&u)[]) {}
 
int main() {
  f({1, 2, 3, 4, 5}); // Doesn't work
}
 
-- 
Danil Sidoruk

Received on 2024-07-16 12:15:04