is typename c++11 or plain old c++?

 
-------------
Jim Michaels
jmich...@yahoo.com
j...@renewalcomputerservices.com
http://RenewalComputerServices.com
http://JesusnJim.com (my personal site, has software)
---
IEC Units: Computer RAM & SSD measurements, microsoft disk size measurements 
(note: they will say GB or MB or KB or TB when it is IEC Units!):
[KiB] [MiB] [GiB] [TiB]
[2^10B=1,024^1B=1KiB]
[2^20B=1,024^2B=1,048,576B=1MiB]
[2^30B=1,024^3B=1,073,741,824B=1GiB]
[2^40B=1,024^4B=1,099,511,627,776B=1TiB]
[2^50B=1,024^5B=1,125,899,906,842,624B=1PiB]
SI Units: Hard disk industry disk size measurements:

[KB] [MB] [GB] [TB]
[10^3B=1,000B=1KB]
[10^6B=1,000,000B=1MB]
[10^9B=1,000,000,000B=1GB]
[10^12B=1,000,000,000,000B=1TB]
[10^15B=1,000,000,000,000,000B=1PB]





On Sunday, November 17, 2013 11:04 PM, K. Frank <kfrank2...@gmail.com> wrote:
 
Hi Jim!
>
>On Mon, Nov 18, 2013 at 1:33 AM, Jim Michaels <j...@boohoo.com> wrote:
>> Hi.
>> I noticed that c++ templates define types using the keyword class,
>
>However (as of a while ago), you can also use the keyword "typename"
>for this purpose, i.e. "template<typename T> void template_function ...",
>and the like.
>
>> and then
>> you use them you plug in the data type, like double.
>
>Yes ...
>
>> is double actually a class?
>
>No, double (and int, etc.) is "naive" or "built-in" type, or whatever
>they call it.
>It is not a class.
>
>> does it have data members I can look at? because
>> if it does,
>
>It doesn't (not a class).
>
>> ...
>> I have not seen this discussed because I was told it's an integral data
>> type. but this doesn't explain why it can be used with class... I was taught
>> only classes could be used with class, (but then we just kinda did templates
>> and didn't discuss).
>
>I think that the use of the keyword "class" in "template <class T> void func"
>came about because the keyword class was available, and not ambiguous
>in this context, and at the time there was not the desire to introduce a new
>keyword.  But it really means "type" or "typename" or whatever, and applies
>equally well to built-in types as to classes.  So it's a somewhat inaccurate
>use of the word "class".
>
>Then the keyword "typename" was introduced (maybe in c++03?), and one
>of its uses was as a synonym for "class" in "template <class T>".  I prefer
>using the newer version, "template <typename T>", basically for the reason
>you give:  "class" is a little bit inaccurate and confusing, while "typename"
>more accurate reflects what "template <typename T>" means.
>
>But this is all just a very minor, superficial detail, and, in
>practice, you should
>get used to seeing both "template <class T>" and template <typename T>"
>in real (and high-quality) code.
>
>> any help appreciated.
>>
>> maybe I need to take this up on a c++ newsgroup?
>
>Yes, one of the c++ newsgroups might be a little better fit, as this is a
>pure c++ question, and not specific to mingw-w64.
>
>
>> but I had hopes someone
>> from the compiler set would know an answer to this. I don't have
>> stroutsrup's book available to me.
>>
>> -------------
>> Jim Michaels
>> ...
>
>
>Happy Generic Hacking!
>
>
>K. Frank
>
>------------------------------------------------------------------------------
>DreamFactory - Open Source REST & JSON Services for HTML5 & Native Apps
>OAuth, Users, Roles, SQL, NoSQL, BLOB Storage and External API Access
>Free app hosting. Or install the open source package on any LAMP server.
>Sign up and see examples for AngularJS, jQuery, Sencha Touch and Native!
>http://pubads.g.doubleclick.net/gampad/clk?id=63469471&iu=/4140/ostg.clktrk
>_______________________________________________
>Mingw-w64-public mailing list
>Mingw-w64-public@lists.sourceforge.net
>https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
>
>
>
>
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to