Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Why shouldn't it be a function? The global namespace is a scarce resource.

constexpr can't be a function because it is not used a such. Nullptr could have been std::nullptr, but it is used often enough that it made sense to put it in the global namespace (but note that it had to be nullptr instead of null to avoid collisions, so only two chars saved). The type is still std::nullptr_t.

The C++ standard doesn't really use __ as a prefix, it is a namespace reserved for the implementor. The _t suffix in the global namespace is from POSIX originally then adopted by C; C++ still puts _t names under std.

std::unreachable is a very obscure functionality, polluting the global namespace for it wouldn't have been a good idea.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: