C++ Logo

std-proposals

Advanced search

[std-proposals] Hope that std::optional and comma expressions can work this way

From: Simon W <inte2012_at_[hidden]>
Date: Wed, 21 May 2025 16:12:11 +0800
The comma expression requires that the expressions on both sides of the
colon are of the same type. But I think this syntax should be accepted:

bool AllInUniversial();

std::optional<int> r = AllInUniversial() ? 42 : std::nullopt;

Received on 2025-05-21 08:12:09