Cppfront: Autumn Update
herbsutter.com
herbsutter.com
Also starting enums at 1 instead of 0 is an odd choice, if you'll pardon the pun.
[1] https://herbsutter.com/2023/04/30/cppfront-spring-update/
It's really common though to use enums as array indices, which start at 0.
I don't know that I've ever directly used an enum as an index, but I guess if I did I'd have to bias it.
So, I think we have
// new type
foo = std::vector<int>;
// alias of existing type
bar == std::vector<int>;
I guess that could evolve to (or maybe already has evolved to?) // variable with initial value
foo: int = 42;
// constant
bar: int == 42;Haskell type vs new type: https://typeclasses.com/coerce
Python NewType: https://docs.python.org/3/library/typing.html#newtype