473,486 Members | 2,427 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Templates vs Inheritance Literature?

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
Nov 30 '05 #1
6 2093
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/020...lance&n=283155)
on page 185 you can find some very interesting infromation about the
differnces.

Bye,
Sebastian

Nov 30 '05 #2
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.

Dec 1 '05 #3
Ravi Rao wrote:
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.
Dec 1 '05 #4
Greg wrote:
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
Dec 1 '05 #5
Try _Multi-Paradim Design for C++_.

HTH,
Noel

Dec 1 '05 #6
Viktor Prehnal wrote:
Greg wrote:
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?


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/bookst...201704315&rl=1

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

Ben Pope
Dec 1 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

37
2786
by: Mike Meng | last post by:
hi all, I'm a newbie Python programmer with a C++ brain inside. I have a lightweight framework in which I design a base class and expect user to extend. In other part of the framework, I heavily...
1
1625
by: Markus Seeger | last post by:
Hi, I'm writing a commandline argument parser that can handle switches by using some techniques similar to the Qt slot mechanism. example: // inheritance method (what I'm trying at the...
10
2630
by: davidrubin | last post by:
Structural inheritance (inheriting implementation) is equivalent to composition in that a particular method must either call 'Base::foo' or invoke 'base.foo'. Apparantly, The Literature tells us to...
3
2530
by: darkstorm | last post by:
I have a doubt regarding inheritance involving templates Consider this: ///////////////////////////////////// template<typename T> class A { private: T m_a;
10
9603
by: makc.the.great | last post by:
now that I am looking at templates, there's the question. why same effect couldn't/shouldn't be achieved with inheritance? provided the difference of the two, when and where do I use templates...
11
1801
by: Peter Oliphant | last post by:
Is there any plan to support templates with managed code in the (near) future? For instance, VS.NET 2005... : )
4
1478
by: qning88 | last post by:
I would like to find out how I can effectively make use of templates in theexample below. In Class A, I have 3 overloaded member functions "send" for handling the different messages. Although...
25
3286
by: Ted | last post by:
I'm putting the posts that follow here (hopefully they will follow here!) because they were rejected in comp.lang.c++.moderated. It behooves anyone reading them to first read the the thread of the...
5
1862
by: Lars Hillebrand | last post by:
Hello, i discovered a weird behaviour if i use templates together with virtual inheritance and method over. I managed to reproduce my problem with a small example: // *********** <code...
0
6964
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7126
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
5434
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4865
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4559
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3070
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3070
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
598
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
262
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.