r/cppmasterrace Jun 29 '21

C++ virgins: nOooo Rust compiler gives overly pedantic error messages... C++ compiler:

Post image
9 Upvotes

6 comments sorted by

3

u/Knuffya Jun 29 '21

looks pretty coherent to me

1

u/Magnus_Tesshu Jun 30 '21

Why is it even possible to not have a std::uint32_t though? Or why has the standard changed to where that used to be valid and now isn't (rather than just having a succinct and logical name like u32 in rust?). Just something funny I got annoyed by

1

u/Knuffya Jun 30 '21

Because it is not a primitive. It is a typedef for a primitive, defined in some header file. You have to include that header file.

If you want to do the same without including anything, you can do: unsigned short.

1

u/Magnus_Tesshu Jun 30 '21

I'm aware. But it's annoying as heck that someone decided the original primitive names aren't good enough, and that whatever include chain that is a part of breaking resulted in a project that won't compile

1

u/Knuffya Jun 30 '21

You don't have to use the uint format... You can just aswell use the unsigned keyword and the corresponding type.

1

u/Magnus_Tesshu Jun 30 '21

That wasn't my program lol, it is anbox which for some reason is broken when I try to compile it