An Idiot's Guide to C++ Templates -- Ajay Vijayvargiya

A lot of people appreciated the information in this pair of articles, which cover the noted topics:

An Idiot's Guide to C++ Templates -- Part 1

The Syntax Drama

Function Templates

  • Pointers, References and Arrays with Templates
  • Multiple Types with Function Templates
  • Function Template -- Template Function
  • Explicit Template Argument Specification
  • Default Arguments with Function Templates

Class Templates

  • Multiple Types with Class Templates
  • Non-type Template Arguments
  • Template Class as Argument to Class Template
  • Default Template Arguments with Class Templates
  • Class' Methods as Function Templates

An Idiot's Guide to C++ Templates -- Part 2

Requirements from the Underlying Type

  • Requirements: Function Templates
  • Requirements: Class Templates

Separation of Declaration and Implementation

  • Separating Class Implementation

Templates and Other Aspects of C++

  • Class Templates, Friends
  • Class Templates, Operator Overloading
  • Class Templates, Inheritance
  • Function Pointers and Callbacks
  • Templates and Virtual Functions
  • Templates and Macros
  • Function Overloading

STL - An Introduction

Templates and Library Development

Explicit Instantiation

Add a Comment

Comments are closed.

Comments (1)

0 0

FaTony said on May 1, 2013 12:23 AM:

[div class="codeblock"] template<class T>
double GetAverage(T tArray[]int nElements
[/div]

Classical security vulnerability. Just pass a negative value to nElements and you have a buffer overrun.

No wonder it's called an idiot's guide.