C++ code with auto
as a part of lambda argument type is accepted by GCC, e.g.:
#include <vector>
#include <iostream>
int main()
{
auto make_vector = []( std::initializer_list<auto> v )
{ return std::vector<typename decltype(v)::value_type>{v}; };
auto v = make_vector( {1,2} );
std::cout << v[0] << ' ' << v[1] << '\n';
}
https://gcc.godbolt.org/z/z43bEjMc9
Here the argument type is std::initializer_list<auto>
and it is really convenient sometimes. But other compilers complain:
A template-argument cannot be a type that contains 'auto'
Is it a GCC-only extension of the language or a new C++ feature that will appear in other compilers as well? If the first is the case then how can it be turned off to maximize language conformance?