Templates vs Inheritance Literature?

R

Ravi Rao

Hi,

This is about "templates vs inheritance" (please, before you flame me, I do
understand that they cover largely non-intersecting domains).

Apart from D&E*, I've found either online discussions filled with a lot of
"noise" which is very distracting, or literature that doesn't specifically
"compare" the two. I do have access to resources that address the two topics
individually, and I'm wondering if you have any recommendations on which
ones I should look at for a study I'm doing on comparing the two.

All help will be duly credited/acknowledged, of course.

And yes, I have looked at the C++ faq-lite ...

many thanks,

--ravi.

* The Design and Evolution of C++, Bjarne Stroustrup
 
S

Sebastian Faust

Hi,
Apart from D&E*, I've found either online discussions filled with a lot of
"noise" which is very distracting, or literature that doesn't specifically
"compare" the two. I do have access to resources that address the two topics
individually, and I'm wondering if you have any recommendations on which
ones I should look at for a study I'm doing on comparing the two.
Take a look at Scott Meyers' book "Effective C++"
(http://www.amazon.com/gp/product/0201924889/002-7038120-2500861?v=glance&n=283155)
on page 185 you can find some very interesting infromation about the
differnces.

Bye,
Sebastian
 
G

Greg

If you are interested in learning how templates and inheritance can
work together then "Modern C++ Design: Generic Programming and Design
Patterns Applied" by Andrei Alexandrescu is a must read. Actually, it's
probably a must read anyway. It's a perspective-changing book.
 
M

Mark P

Ravi said:
Hi,

This is about "templates vs inheritance" (please, before you flame me, I do
understand that they cover largely non-intersecting domains).

Apart from D&E*, I've found either online discussions filled with a lot of
"noise" which is very distracting, or literature that doesn't specifically
"compare" the two. I do have access to resources that address the two topics
individually, and I'm wondering if you have any recommendations on which
ones I should look at for a study I'm doing on comparing the two.

All help will be duly credited/acknowledged, of course.

And yes, I have looked at the C++ faq-lite ...

many thanks,

--ravi.

* The Design and Evolution of C++, Bjarne Stroustrup

Check out C++ Templates: The Complete Guide which discusses this
distinction.
 
V

Viktor Prehnal

Greg said:
If you are interested in learning how templates and inheritance can
work together then "Modern C++ Design: Generic Programming and Design
Patterns Applied" by Andrei Alexandrescu is a must read. Actually, it's
probably a must read anyway. It's a perspective-changing book.
I have read some reviews on this book and many of them stated that it is
certainly not modern c++ techniques that it is too academic and
unuseful for real coding. What do you think?
More recommended was C++ Templates: The Complete Guide
 
B

Ben Pope

Viktor said:
I have read some reviews on this book and many of them stated that it is
certainly not modern c++ techniques that it is too academic and
unuseful for real coding. What do you think?

Personally I found it very informative and humbling.

The book is heavily templates biased, and discusses the opportunities
for code design that they bring. Possibly the name of the book is not
as informative as it could be.

The supplied library, Loki, is very good also, it aids you to implement
various patterns, encapsulating most of the templating nightmare
required to implement. It also has very good descriptions of those
patterns. I prefer it to the GoF where their concerns cross over,
because it's more pragmatic.

It's worth the price for either of the chapters on policy based design
or smart pointers alone.

Check out the smart pointers chapter at the bottom of this page:
http://www.awprofessional.com/bookstore/product.asp?isbn=0201704315&rl=1

OK, so now you must buy it for the chapter on policy-based design!

Ben Pope
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,682
Members
48,796
Latest member
Greg L.

Latest Threads

Top