Y
Hacker News
new
|
ask
|
show
|
jobs
by
uecker
37 days ago
Oh, you can get the information at compile time as well.
https://godbolt.org/z/hTYbTE8j8
(or
https://godbolt.org/z/K1M68sY3Y
but this will be tricky in a larger code base)
1 comments
bvrmn
37 days ago
That's the reason language/compiler should directly support optionality.
You can't fool yourself and have to handle all cases:
https://godbolt.org/z/4GqMdPej3
link
uecker
36 days ago
So it seems exactly the same to me?
link
bvrmn
35 days ago
Nice one. gcc/clang are smart enough to get .ok condition statically. I'm very curios how complex an expression could be.
link
You can't fool yourself and have to handle all cases: https://godbolt.org/z/4GqMdPej3