473,786 Members | 2,806 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Genericity is *not* templates

According to the C++ FAQ Lite:

http://www.parashift.com/

[34.11] What is "genericity "?

Yet another way to say, "class templates."

Not to be confused with "generality "
(which just means avoiding solutions which are overly specific),
"genericity " means class templates.

This is *not* correct.
Class templates are *not* generally generic.
Usually, class templates are only be used to generate template classes
for a restricted set of types.
Only class templates which are designed to generate template classes
for *all* types are truly generic.
The standard vector class template, for example, is generic but
the standard valarry class template is *not* generic
because it only makes sense for numeric types.

Jul 22 '05
22 2195
E. Robert Tisdale wrote:
E. Robert Tisdale wrote:
[snip]
The standard vector class template, for example, is generic but
the standard valarry class template is *not* generic
because it only makes sense for numeric types.

[snip]
ADJECTIVE:1. Relating to or descriptive of an entire group or class;
general. See synonyms at general.


[snip]

Who says the numeric types don't comprise an "entire group or class"?

From the Oxford Concise English Dictionary, 9th edition, "*generic*
[...] 2 /Biol./ Characteristic of or belonging to a genus." In this
other technical sense, then, genericity is quite a limited thing: it
doesn't refer to entire families, orders, classes, phyla or kingdoms.

--
Regards,
Buster.
Jul 22 '05 #21
On Tue, 06 Apr 2004 11:27:10 -0700, "E. Robert Tisdale"
<E.************ **@jpl.nasa.gov > wrote:
The standard vector class template, for example, is generic but
the standard valarry class template is *not* generic
because it only makes sense for numeric types.

According to your definition below, that isn't a problem.
ADJECTIVE:1. Relating to or descriptive of an entire group or class;
general. See synonyms at general.


valarray relates to the entire group/class of numeric types. What is
non-generic about that?

Tom
--
C++ FAQ: http://www.parashift.com/c++-faq-lite/
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
Jul 22 '05 #22
On Tue, 06 Apr 2004 11:27:10 -0700, "E. Robert Tisdale"
<E.************ **@jpl.nasa.gov > wrote:
The standard vector class template, for example, is generic but
the standard valarry class template is *not* generic
because it only makes sense for numeric types.

According to your definition below, that isn't a problem.
ADJECTIVE:1. Relating to or descriptive of an entire group or class;
general. See synonyms at general.


valarray relates to the entire group/class of numeric types. What is
non-generic about that?

Tom
--
C++ FAQ: http://www.parashift.com/c++-faq-lite/
C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
Jul 22 '05 #23

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

Similar topics

22
1454
by: E. Robert Tisdale | last post by:
According to the C++ FAQ Lite: http://www.parashift.com/ What is "genericity"? Yet another way to say, "class templates." Not to be confused with "generality" (which just means avoiding solutions which are overly specific),
0
10363
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10164
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9962
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8992
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7515
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6748
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5534
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3670
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2894
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.