Speaking of templates, here’s their all-powerful replacement (or complement, probably) in GLIC:
macro class PrintName {
# Transition to Perl code (should probably be more clearly marked)
sub GENERATE {
my ($class, @params) = @_;
my $template = join(', ', map { $_->name } @params);
<<CODE;
void print() { cout << "My name is $class<$template>\n" }
CODE
}
};
PrintName<int> p;
p.print(); // "My name is PrintName<int>"
Do you have any idea how powerful that is!? And the best part: Do you have any idea how damn easy that is to implement!? So, yay.
