Pattern matching in C++ and D
nise at nise.com
Tue Jan 7 17:06:30 UTC 2020
On Tuesday, 7 January 2020 at 14:00:01 UTC, Francesco Mecca wrote:
> I found a paper regarding a proposal for pattern matching in
> C++ on HN a few days ago:
> let function_with_side_effects x = ...
> let match x = match x with
> | p1 -> e1
> | p2 when function_with_side_effects x -> e2
> | _ -> e3
Doesn't the real benefit first kick in when the statement is an
expression always returning a value like in your example?
Neither C++ or D has that.
More information about the Digitalmars-d