Talk:cpp/types/common type

For some reason it is impossible to make

Wouldn't it be better to implement like this:

--Shchvova (talk) 17:20, 24 February 2015 (PST)


 * C++ is way ahead of you! C++14 specified common_type in terms of, but the current C++17 draft already states that the two args of the conditional operator are xvalues. This was part of LWG 2408 that wasn't yet reflected on this cppreference page. Since it's classified as a defect in C++14, I believe you are justified to file bug reports against compilers (technically, against library implementations) --Cubbi (talk) 19:21, 24 February 2015 (PST)

Incorrect note
It is stated under Notes, "For arithmetic types, the common type may be viewed as the type of the (possibly mixed-mode) arithmetic expression such as ." This is incorrect when the types are all the same and ranked lower than.

is, but is  (because of course  is ), as demonstrated below:

--Oktal (talk) 10:55, 12 March 2015 (PDT)
 * Good point! The note may have to be turned around to say that it *can't* be used to indicate the result of a mixed-type arithmetic expression. --Cubbi (talk) 11:10, 12 March 2015 (PDT)