3 ms·
To expand on this for non-C++ programmers, scope is important in C++ because it is used for resource management via RAII [1]. In most languages, in most cases,
by dkarl 9y ago
To expand on this for non-C++ programmers, scope is important in C++ because it is used for resource management via RAII [1].
In most languages, in most cases, scopes within a function are used to enhance readability rather than to specify program logic, so a feature like this would add more complexity than it removes.
[1] http://en.cppreference.com/w/cpp/language/raii http://en.cppreference.com/w/cpp/language/raii