Sunday, May 06, 2007

iterator tags idiom and compile-time algorithm selection

Compile-time algorithm selection can be done using function overloading and traits idiom. It is a quite useful technique in generic programming. In this technique usually a set of "selector" types are used to select one among many overloaded functions. Note that the number of parameters to these overloaded functions is same but there is a "selector" type at the end of the parameter list. A use of that technique based on standard defined iterator tags is shown here.

2 comments:

Anonymous said...

Thanks for sharing this site. you can download lots of ebooks from here

http://feboook.blogspot.com

xander345 said...

if you like c++ you can compile it online here: http://codecompiler.info/

32, 64 - windows & Linux - and more programming languages