template using func_type = decltype(U{}.func()); I admit I'm not following all the new stuff that is added to C++. What are that two lines supposed to mean? I don't know what the U{}.func() and using x = decltype() constructs should mean or their names. The names of these and links highly appreciated. Thanks. Moreover, regarding the "bug": if "U" is actually special as an identifier (e.g. some predefined macro or som…
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…
Re: The weirdest bug I’ve found in a compiler: MSVC 2017
#61Thank you, this is my favorite explanation.