O
Ole Nielsby
The standard (last prelim ed.) says:
---quote---
3.3.7 - Name hiding [basic.scope.hiding]
-2- A class name (class.name) or enumeration name (dcl.enum) can
be hidden by the name of an object, function, or enumerator declared
in the same scope. If a class or enumeration name and an object,
function, or enumerator are declared in the same scope (in any order)
with the same name, the class or enumeration name is hidden wherever
the object, function, or enumerator name is visible.
---quote---
Why is this? What's the point of having a class/enum and a function with
the same name? Any examples of practical use?
---quote---
3.3.7 - Name hiding [basic.scope.hiding]
-2- A class name (class.name) or enumeration name (dcl.enum) can
be hidden by the name of an object, function, or enumerator declared
in the same scope. If a class or enumeration name and an object,
function, or enumerator are declared in the same scope (in any order)
with the same name, the class or enumeration name is hidden wherever
the object, function, or enumerator name is visible.
---quote---
Why is this? What's the point of having a class/enum and a function with
the same name? Any examples of practical use?