On Thu, 20 Oct 2022 at 12:25, Peter Olsson via Std-Proposals <std-proposals@lists.isocpp.org> wrote:
If you don't use a colon (:) does that mean the type of the ?-> expression is always void?

You can't write the following, can you?
    std::cout << ptr?->get_value();

These are equivalent: 

ptr ? std::cout << ptr->get_value(), void() : void();
ptr ?  std::cout << ptr->get_value()   : std::cout; 
if (ptr) std::cout << ptr->get_value();

The "optional operator" is unnecessary syntactic sugar found in a couple of populist languages.


>The three-way comparison operator <=> is 3 chars long; ?-> now seems
reasonable IMHO.

There are also <<= and >>= so I don't think the length should be controversial.
--
Std-Proposals mailing list
Std-Proposals@lists.isocpp.org
https://lists.isocpp.org/mailman/listinfo.cgi/std-proposals