It is currently Tue Aug 22, 2017 1:31 pm

All times are UTC - 5 hours




 Page 1 of 1 [ 4 posts ] 
Author Message
 Post subject: More On Templates
PostPosted: Thu Mar 08, 2012 5:53 pm 

Joined: Sat Aug 16, 2008 7:58 am
Posts: 448
It would be very nice to have a fairly detailed VMK on templates. The existing VMK is very nice and helpful. What would be nice to see in a new VMK on templates is a methodical explanation of how to implement templated structures and classes. How to define the constructors properly when a default constructor is not adequate, using inline features, nested classes, derived classes, wrapper classes, etc. What are the pitfalls vs peformance efficiency, etc. This would be a great reference VMK to use. Another thing to note is the difference with values being passed into constructors and functions where the parameters are various types: integral, built-in or user-defined, such as being passed in by value, reference or pointer.

The first VMK was great for defining what a template is, how they are useful, but seemed lacking on how to properly implement them where a class/struct is being templated. Another good aspect would be to explain some of the compiler and build errors when working with templates, and how to correct them. Another good question is if a base class is templated is there a way to have a pure virtual constructor or functions that the derived classes must implement, or if not is their a way to have overloaded constructors or functions.

When I try to work on my own projects, I keep getting the error that the constructor being called is an ambiguous overloaded function. The idea here is I am not entirely making the project 100% Object Oriented, or 100% Generic. I am practicing all methods to be more fluent with the language. In return I will be able to constructor a project with great optimization using all aspects where they are needed. Some parts may be better off being generic(templated) and other parts are object-oriented(classes/structs) and/or an even mixture of both. Looking forward for a VMK of this nature in the near future I think would benefit many people for many years to come. Reading MSDN isn't always enough!
It is very good hearing code implementation being explained. I have enjoyed all of your VMK's to-date and continue to wait for the next one.


Offline
 Profile  
 
 Post subject: Re: More On Templates
PostPosted: Mon Mar 12, 2012 7:29 am 

Joined: Fri Sep 04, 2009 3:24 am
Posts: 30
I'd be interested in something like this too.


Offline
 Profile  
 
 Post subject: Re: More On Templates
PostPosted: Fri Mar 16, 2012 5:39 am 
Site Admin

Joined: Sun Feb 11, 2007 8:59 am
Posts: 1105
Location: Ontario Canada
Until I can find some spare time to make some more video's, I'll refer you to this article:
http://www.codeproject.com/Articles/257 ... tes-Part-1


Offline
 Profile  
 
 Post subject: Re: More On Templates
PostPosted: Fri Mar 16, 2012 1:00 pm 

Joined: Sat Aug 16, 2008 7:58 am
Posts: 448
Ok, thank you :)


Offline
 Profile  
 
Display posts from previous:  Sort by  
 Page 1 of 1 [ 4 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Jump to:  

cron