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-Thread: 103376,a84eaf8fb2470909 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!nx02.iad01.newshosting.com!newshosting.com!130.81.64.211.MISMATCH!cycny01.gnilink.net!spamkiller2.gnilink.net!gnilink.net!trndny09.POSTED!0e8a908a!not-for-mail From: Hyman Rosen User-Agent: Thunderbird 1.5.0.9 (Windows/20061207) MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: Ada generics References: <1166710494.869393.108730@a3g2000cwd.googlegroups.com> <17fe4xfogg7p5.1dcyc5nyc2gsl.dlg@40tude.net> <1166805696.291429.239590@48g2000cwx.googlegroups.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: Date: Mon, 25 Dec 2006 13:49:23 GMT NNTP-Posting-Host: 70.19.111.106 X-Complaints-To: abuse@verizon.net X-Trace: trndny09 1167054563 70.19.111.106 (Mon, 25 Dec 2006 08:49:23 EST) NNTP-Posting-Date: Mon, 25 Dec 2006 08:49:23 EST Xref: g2news2.google.com comp.lang.ada:8007 Date: 2006-12-25T13:49:23+00:00 List-Id: Dmitry A. Kazakov wrote: > Automatic conversions do not represent any special case. If S is > convertible to T, then S is a subtype of T That simply is not the case in C++. Automatic conversions do not define subtypes in any meaningful or useful sense. For example, all the numeric types automatically convert to each other. It's also possible to write automatic conversions between arbitrary classes. It may be chaotic as you say, but that's the way the language is, and templates have to work within that framework. "Concepts" will be useful to those people who want the ability to specify such constraints. > Exactly. The idea of structural matching is wrong. It's not wrong, and it's not even structural. It is in fact matching by name, not by structure. It's only in the case of constant expressions that things go a little awry. But if you recall the discussions we've had here on implementing units, it lets C++ do things that are impossible in Ada. > It is actually the difference between packages in Ada and classes in C++. > They are not equivalent. Not entirely, naturally, but classes in C++ are used for the same kind of structuring purposes as Ada packages. Certainly C++ classes are used to define bundles of types, constants, and functions, and that can be done generically.