[Effective-cpp] Item 35: Familiarize yourself with the langu age standard

Adrian Fagg AdrianF at evaluategroup.com
Tue Jun 10 04:08:32 EDT 2003


> -----Original Message-----
> From: Jaspreet Singh [mailto:Jasingh at quark.co.in]

> i think the "class T" is just a workaround for a parent 
> "Object" class as in java.

No, definitely not. Before the STL came on the scene, there were many
libraries that took just that approach, providing collections of some
'universal' base class.
If we didn't use the commercial libraries (RW etc.) we used our own.
The STL swept that stuff away pretty comprehensibly. Incidentally - not
least amongst the reasons for the swift victory of the STL is its
comparative simplicity - the interfaces for the old collection classes were
generally monsters.

> a template can be used whenever we need a family of 
> classes/functions... but
> i haven't come across such a situation.

It's hard to write modern C++ without making use of templates. On the other
hand, I think that there are plenty of application areas where you may never
need to write your own templates - although as time goes by and a project
matures, I'd be surprised if refactoring doesn't lead you down that path as
well.

Nevertheless, I do believe that when you compare different languages and
their apparently divergent paradigms, you often find ways that each achieves
the same thing by different means.

Regards,

Adrian

Work: mailto:adrianf at evaluategroup.com
Home: mailto:adrian.fagg at ntlworld.com

Pretty pictures: http://homepage.ntlworld.com/rbyadf/ 


DISCLAIMER: The contents of this e-mail are confidential and are intended
for the individual or entity named in the e-mail address. If you are not the
intended recipient (or their designated representative), you should notify
the sender immediately and delete the e-mail and any attachments. All
information contained in this e-mail is private and confidential. 

All reasonable precautions have been taken to ensure no viruses are present
in this e-mail. But as we cannot accept responsibility for loss or damage
arising from the use of this e-mail or attachments we recommend that you
subject these to your own virus checking procedures prior to use. 




--- StripMime Report -- processed MIME parts ---
multipart/alternative
  text/plain (text body -- kept)
  text/html
---



More information about the Effective-cpp mailing list