I just found that in library fundamentals TS v2 there is a make_array
(std::experimental::make_array
) template that allows to deduce an arrays type from its parameters. I guess the main intention was to enable usage of auto
similar to the example on cppreference:
auto x = std::experimental::make_array(1,2,3,4,5);
Is there a different motivation that I don't see?
With the new type deduction facilites in C++20, can one still expect that make_array
will make it into the standard one day, or is it already obsolete?
make_array(1,'2',3,4,5)
or make_array<float>(1,'2',3,4,5)
would be valid whereas Class Template Argument Deduction (CTAD) of std::array
only allows same type.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With