From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM autolearn=ham autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,d2f0af5e440b367f X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-07-08 17:12:35 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!in.100proofnews.com!in.100proofnews.com!cycny01.gnilink.net!cyclone1.gnilink.net!wn12feed!worldnet.att.net!bgtnsc05-news.ops.worldnet.att.net.POSTED!not-for-mail Newsgroups: comp.lang.ada Subject: Re: proposal for new assignment operators From: James Rogers References: <3EF9CD5F.6030608@cogeco.ca> <3doRhIgUmUYX@eisner.encompasserve.org> <3F038B77.2F2E41B7@adaworks.com> <1057672755.789189@master.nyc.kbcfp.com> Message-ID: User-Agent: Xnews/5.04.25 Date: Wed, 09 Jul 2003 00:12:35 GMT NNTP-Posting-Host: 12.86.36.247 X-Complaints-To: abuse@worldnet.att.net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1057709555 12.86.36.247 (Wed, 09 Jul 2003 00:12:35 GMT) NNTP-Posting-Date: Wed, 09 Jul 2003 00:12:35 GMT Organization: AT&T Worldnet Xref: archiver1.google.com comp.lang.ada:40133 Date: 2003-07-09T00:12:35+00:00 List-Id: Hyman Rosen wrote in news:1057672755.789189@master.nyc.kbcfp.com: > Template parameters are used in the linkage of instantiated templates > (loosely speaking, the parameters are interpolated into the name of the > instantiation), and template arguments can be constant expressions. > Allowing floating-point parameters would lead to questions of equivalence > of instantiations. In my opinion that's not such a terrible burden, and I > would have allowed it, but the standard doesn't. Some compilers offer it > as an extension. > > As a sample of the problem, consider > template char *f() { static char c; return &c; } > bool b = f<1./3.>() == f<1./6.+1./6.>(); > How do you specify what the value of 'b' should be? > Interesting. I suppose part of the problem can be the algorithm for interpolation of the parameter(s) into an instance name. Does the standard specify this algorithm, or is that 'implementation defined'? If the standard does not specify the interpolation algorithm I would expect object files from different compilers to be incompatible with each other when instantiating a template from a commonly referenced header file. Are the parameters also available within the body of the template for logic purposes? Jim Rogers