home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c++.moderated      Moderated discussion of C++ superhackery      33,346 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 31,895 of 33,346   
   Miles Bader to James K. Lowden   
   Re: template class with non-type-param t   
   08 Feb 12 00:48:27   
   
   From: miles@gnu.org   
      
   "James K. Lowden"  writes:   
   > template   
   > class Range   
   ...   
   > Note that T cannot be just any type.  It can be integral or a pointer,   
   > but not e.g. float.   
      
   Hmm, I've always wondered:  why do the C++ standards always so oddly   
   biased against scalar floating-point types, in that there are various   
   places like this where "int" is allowed but not "float" (the biggie, of   
   course, being static-const-data-member initialization in C++98)...?   
      
   It would surely be very convenient for the programmer if float/double   
   were allowed, it would make the language seem more consistent, and I   
   can't see that it would present any particular implementation   
   difficulties...   
      
   Thanks,   
      
   -Miles   
      
   --   
   古 や 蛙飛び込む 水の音 [松尾芭蕉]   
      
      
         [ See http://www.gotw.ca/resources/clcm.htm for info about ]   
         [ comp.lang.c++.moderated.    First time posters: Do this! ]   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca