Slashdot Mirror


Function Template Specialization in C++

friedo writes "About.com has an excellent two-part article (Part 1, Part 2) by Eric Nagler, author of "Learning C++," about "specializing" function templates in C++. "Rather than specifying an explicit type of all of the arguments or the return value in the definition of a function, placeholders are used. This reduces the need to create and maintain multiple copies of a function for different parameter types. But sometimes, it is not possible to write a single function template that works efficiently or even correctly for every argument type. It is in these cases that function template specialization is useful.""

2 of 89 comments (clear)

  1. Re:Parametric polymophism. by kruntiform · · Score: 2, Funny

    If I may troll just a little, the first one is better because most programmers are afraid of anything that doesn't look like C and because they like to type in lots of boilerplate code because it makes them feel productive.

  2. Upcoming "Developers" Headlines: by avdi · · Score: 2, Funny

    Variable Assigment in Java
    Using Perl Regular Expressions to Process text
    Python Operator Overloading
    Using Lisp Macros

    --

    --
    CPAN rules. - Guido van Rossum