|
From: | Kai Antweiler |
Subject: | Re: [glob2-devel] A lot of small changes. |
Date: | Wed, 04 Apr 2007 21:32:24 +0200 |
User-agent: | Gnus/5.1007 (Gnus v5.10.7) XEmacs/21.4.20 (linux) |
> If it's there it's either for speed and to avoid code duplication ; both are > very good reasons. I think the reason is avoiding code duplication. Templates were also designed to help with this. ps: There is some hype about template metaprogramming now. A lot of people do weird things with templates. (e.g: http://www.boost.org/libs/mpl/doc/index.html) Something simple but unfamiliar: template <int d> int inc( int& a ) { return a+=d; } ... int n=7; std::cout << inc<4>(n); Real C++ code, but the "int" keyword instead of "class" or "typename" looks very strange to me. -- Kai Antweiler
[Prev in Thread] | Current Thread | [Next in Thread] |