PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

Take out your sniper gun, I'm out of topic!

Sorry for the out of topic question, but here goes.

You (sbl) talked about templates a few times already. I tried to search the web for infos on them, but I only found either implementation description or descriptions that I was unable to understand...

Could you please describe what a template is, and what benefits can be gained from them?

Thanks!

WHAM! <efortier> got one in the head!
Templating is far to complex of a topic to cover in a forum. You're best bet is to buy a book like http://www.amazon.com/exec/obidos/ASIN/ ... 77-0266338 which has a large section dedicated to templates, how they work and what they do for you. It's the most powerful feature in the C++ language, but can be a beast to grasp at first.

Another good area to learn more about templates is a topic called "meta programming". It's programming in C++ using templates to make the compiler write your code for you. IE unrolling inner loops, etc. That's one of the template techniques GapiDraw and PocketFrog use I believe.