C++
  Home arrow C++ arrow Templates in C++
Dev Articles Forums 
ADO.NET  
Apache  
ASP  
ASP.NET  
C#  
C++  
ColdFusion  
COM/COM+  
Delphi-Kylix  
Design Usability  
Development Cycles  
DHTML  
Embedded Tools  
Flash  
Graphic Design  
HTML  
IIS  
Interviews  
Java  
JavaScript  
MySQL  
Oracle  
Photoshop  
PHP  
Reviews  
Ruby-on-Rails  
SQL  
SQL Server  
Style Sheets  
VB.Net  
Visual Basic  
Web Authoring  
Web Services  
Web Standards  
XML  
Dedicated Servers  
Moblin 
JMSL Numerical Library 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
C++

Templates in C++
By: Gabor Bernat
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 2 stars2 stars2 stars2 stars2 stars / 3
    2008-06-17

    Table of Contents:
  • Templates in C++
  • Starting with Templates
  • Class Templates
  • Template Specialization

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Templates in C++


    (Page 1 of 4 )

    Templates have been helping programmers to change the way they are able to code since the ealy 1990s. Since that time they have advanced rapidly, and in this tutorial we will take a close look at them and learn to use them to effectively decrease our tasks.

    Templates, as a programming concept, redefined the way we are able to code nowadays. Templates appeared back in the early 1990s and soon after, they started to advance rapidly. For this reason, the legendary author Scott Meyers decided to skip over templates; thus, they aren’t covered in the book, “Effective C++.”

    Later in 1995, despite the fact that he wrote a chapter on templates, the author decided not  to include  it in the published edition of the book, More Effective C++, since he thought that this area was still experiencing growth and evolution.

    He was quite right. This so-called evolution lead to the rise of one of the most crucial items for a C++ programmer in the 21st century: the template libraries. Here we can include one of the best known libraries, the STL (Standard Template Library), which is also included in Visual Studio's STD.

    But there exist many others that are just as important; for example, the boost library or the Loki library of Andrei Alexandrescu. All of these rely on templates and you must be very familiar with them if you plan to become a good, efficient, and fast C++ programmer.

    I want to congratulate you for investing your time in something that I can promise you won't regret. This article will teach you all that you need to know about templates. It can be considered a prequel to the STL library introduction article.

    We're going to begin with function templates, followed by class templates, and conclude with template specialization or non-type parameters for templates. All of this will be covered, so prepare yourself for more knowledge and let's begin!

    More C++ Articles
    More By Gabor Bernat


       · Templates are reminding you till a point about the for statement. Back in the early...
     

    C++ ARTICLES

    - Multiplying Large Numbers with Karatsuba`s A...
    - Large Numbers
    - Dijkstra`s Shunting Algorithm with STL and C...
    - Brief Introduction to the STL Containers
    - The Standard Template Library
    - Templates in C++
    - C++ Programmer Alerts
    - C++ Programming Tips
    - First Steps in (C) Programming, conclusion
    - First Steps in (C) Programming, continued
    - First Steps in (C) Programming, introduction
    - C++ Preprocessor: Always Assert Your Code Is...
    - C++ Preprocessor: The Code in the Middle
    - Programming in C
    - Temporary Variables: Runtime rvalue Detection







    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway