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,7f2ce8bda9cae4ab X-Google-Attributes: gid103376,public Path: controlnews3.google.com!news1.google.com!news.glorb.com!prodigy.com!prodigy.com!news-feed01.roc.ny.frontiernet.net!nntp.frontiernet.net!uunet!ash.uu.net!spool.news.uu.net!not-for-mail Date: Mon, 17 May 2004 13:40:02 -0400 From: Hyman Rosen User-Agent: Mozilla Thunderbird 0.5 (Windows/20040502) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: "Must instantiate controlled types at library level." Why? References: <1676457.GMYvKY1ieA@linux1.krischik.com> <1616198.O4tUV8TdF7@linux1.krischik.com> <87lljuvd6j.fsf@insalien.org> <874qqgpjok.fsf@insalien.org> <3tVpc.34871$vz5.29965@nwrdny01.gnilink.net> <2004517-94829-360098@foorum.com> <1084806067.140519@master.nyc.kbcfp.com> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Organization: KBC Financial Products Message-ID: <1084815602.254381@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@nightcrawler.nyc.kbcfp.com X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1084815602 15210 204.253.250.10 Xref: controlnews3.google.com comp.lang.ada:644 Date: 2004-05-17T13:40:02-04:00 List-Id: Georg Bauhaus wrote: > Is an approach based on discipline and > conventinalism on a par with language definitions? Shrug. How many students of Ada have fallen down trying to create an array of ragged strings? > Somewhat related to this, you can have template parameter constraints > But is it the same as saying > generic type G is new C with private; Not really, but especially in C++, there are philosophical arguments against constraining template parameters in this way. Because of the many possible ways in which a construct might work (because of automatic conversions, etc.), and because uninstantiated template functions don't need to be correct for types with which they are not used, it's better to let the compiler complain on inapprpriate instantiations instead of trying to capture a priori constraints.