如何在 C++ 中重载三元运算符 (?:)?

How to overload the ternary operator (?:) in C++?

如何在 C++ 中重载此比较运算符?

(statement)?(if true):(if false)

你不能 (§13.5/3):

The following operators cannot be overloaded: . .* :: ?: nor can the preprocessing symbols # and ## (Clause 16).