3 ms·
Here is a link that describes value initialization: http://en.cppreference.com/w/cpp/language/value_initialization http://en.cppreference.com/w/cpp/language/val
by tcbawo 8y ago
Here is a link that describes value initialization: http://en.cppreference.com/w/cpp/language/value_initialization http://en.cppreference.com/w/cpp/language/value_initializati... and aggregate initialization: http://en.cppreference.com/w/cpp/language/aggregate_initialization http://en.cppreference.com/w/cpp/language/aggregate_initiali...
Either of which could apply to 'U{}'.
decltype is just returning the result type of the contained expression, which is the return type of the method 'func' called on a default or value initialized instance of type U. A lot of times people will use std::declval<U>() instead which returns a reference to U w/o needing to call a valid constructor (https://en.cppreference.com/w/cpp/utility/declval https://en.cppreference.com/w/cpp/utility/declval).
The templated using statement is creating a template type 'func_type<U>' which is similar to a typedef.