Why are STL's iterators exposing their container's internals? Why are iterator's member variables mostly public?

std::list‘s iterator is a struct, not a class. In some implementations, it has the node pointer public and accessible to the user. Therefore, a user should be able to "accidentally" modify a link and break the relationships within the list through an iterator. Why is this possible? I do get that the member functions of… Read More Why are STL's iterators exposing their container's internals? Why are iterator's member variables mostly public?

Why are linux system calls different across architectures

According to this system calls table, linux system calls are different across architecture, but IMO syscalls are higher level encapsulation which do not depent on any specific architechture. Why is it designed this way? In a specific case, riscv64 linux doesn’t have mkdir, instead it has mkdirat, but weirdly it doesn’t have rmdir or rmdirat,… Read More Why are linux system calls different across architectures