C++ pattern matching is coming

ryuukk_ ryuukk.dev at gmail.com
Fri Oct 28 14:44:52 UTC 2022


On Friday, 28 October 2022 at 14:42:14 UTC, IGotD- wrote:
> On Friday, 28 October 2022 at 14:19:20 UTC, ryuukk_ wrote:
>>
>> We should have learnt from Kotlin, C#, Zig, Rust and countless 
>> more languages, and make it `?` and call it optional, but 
>> nope, it had to be a template, and the syntax changed at will 
>> by its author without consertation and consideration for its 
>> users!
>
> Rust do not have a "type?" in order to make it an optional what 
> I know about. You have to use Optional<T>. The Rust syntax is 
> very explicit and often not that nice to read. Also Rust does 
> not have optional chaining (ex. let i = var1?.var2?.var3) like 
> C# and Swift which is really nice. In Rust you must use 
> "and_then" or nested if let statements which is super ugly.

I should have developed further, but you did it for me so thanks


More information about the Digitalmars-d mailing list