3 ms·
IIRC, Pascal had the opposite problem. Typedefs were considered distinct even if the underlying type was the same.
by anonymous246 16y ago
IIRC, Pascal had the opposite problem. Typedefs were considered distinct even if the underlying type was the same.
- humbledrone 16y agoIt would be really handy if C++ supported both its existing typedef behavior (aliasing) and the Pascal kind (distinct copy). I wonder if any other strongly typed languages (e.g. Haskell) support both kinds of behavior.
- dododo 16y agohaskell does support it. c style: type Foo = Int pascal style: newtype Foo = Foo Int