4 ms·
Using allows for type aliases like typedef but with a more readable syntax. Decltype will take the type of the expression within. So the U{} constructs a valu
by beached_whale 8y ago
Using allows for type aliases like typedef but with a more readable syntax. Decltype will take the type of the expression within. So the U{} constructs a value of type U and then the func() is called. So func type will either be complete when the struct has a func member function or not. The void_t is always void but only if the template arguments are complete. So when func exists it will be a true type else a false type. True and false type are integral constants that have a constant value member
- acqq 8y agoThank you, this is my favorite explanation.