Why is 'int' used as just int and why not as std::int in C++?

deadLock :

Unlike everything is standardized in current C++, are there any specific reasons to leave int, char, ...., main() and others from it. (Not talking of +,-,%,.. because they aren't language-specific)

Why is it not like:

std::int std::main(std::int argc, std::char *argv[])
{
    //Sample C++ code (incorrect with current standards though)
    std::return 0;
}

Isn't standardization incomplete with them out of std scope?

What I believe is, they are basic components which occurs everywhere when writing a program, whether simple or complex. They are not included in the standardization, just to follow the DRY principle.

vll :

Keywords such as int and return and the main() function are all included in the C++ standard. std does not mean that only those things are standardized. Instead, it refers to the things that are in the standard library (which, like keywords, is a part of the standard). Include files such as #include <vector> are needed to use the standard library, but keywords can be used without any #includes.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=368884&siteId=1