3 ms·
Interesting, I haven't thought about using it in C++ before. It's an idea that has existed for a long time in languages geared toward safety-critical systems.
by rlupi 2y ago
Interesting, I haven't thought about using it in C++ before.
It's an idea that has existed for a long time in languages geared toward safety-critical systems.
E.g. Derived Types in Ada: https://fsharpforfunandprofit.com/posts/designing-with-types-discovering-the-domain/ https://fsharpforfunandprofit.com/posts/designing-with-types...
It is sometimes used in Ocaml or F# for domain-specific types: https://fsharpforfunandprofit.com/posts/discriminated-unions/#single-cases https://fsharpforfunandprofit.com/posts/discriminated-unions...