A
Alf P. Steinbach
I think it's a language defect, or at least an inconsistency, that a definition
of F generally can't use the same type names as the earlier declaration of F.
The source of this problem is that by current rules the compiler evaluates the
routine result type declaration before knowing which routine it's compiling: the
result type, as opposed to argument types, is not evaluated in the routine's
declaration context.
It would IMHO be nice with consistent rules, the same rules, for arguments and
result types.
Cheers,
- Alf (grumbling)
PS: Of course, an even more missing language feature is some sort of module
support. The administrative overhead of using libraries in C++, specifying
header and library search paths, binary names etc., is O(n^2) where n is the
number of libraries that are being developed within a project. That's silly.
of F generally can't use the same type names as the earlier declaration of F.
The source of this problem is that by current rules the compiler evaluates the
routine result type declaration before knowing which routine it's compiling: the
result type, as opposed to argument types, is not evaluated in the routine's
declaration context.
It would IMHO be nice with consistent rules, the same rules, for arguments and
result types.
Cheers,
- Alf (grumbling)
PS: Of course, an even more missing language feature is some sort of module
support. The administrative overhead of using libraries in C++, specifying
header and library search paths, binary names etc., is O(n^2) where n is the
number of libraries that are being developed within a project. That's silly.