| Marcin 'Qrczak' Kowalczyk 2004-10-31, 8:56 am |
| Lynn Winebarger <owinebar@indiana.edu> writes:
> As the subject indicates, though, I'd like to know whether C++
> templates are hygeinic or not.
No. There are only rules which somewhat increase hygiene, by making
function calls which don't involve template parameters in arguments
resolved at the point of template definition. Other calls are resolved
in a combination of both environments.
In the context of C++ it would not make sense to make all calls in
templates hygienic, because compile-time dispatch relies on calling
an overloaded functions with a particular name - perhaps one defined
after the template.
The problem of hygiene in the other direction, preventing pieces of
code from capturing definitions introduced by the template, doesn't
exist because you can't pass pieces of code to a template.
--
__("< Marcin Kowalczyk
\__/ qrczak@knm.org.pl
^^ http://qrnik.knm.org.pl/~qrczak/
|