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 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,703c4f68db81387d X-Google-Thread: 109fba,703c4f68db81387d X-Google-Thread: 115aec,703c4f68db81387d X-Google-Thread: f43e6,703c4f68db81387d X-Google-Attributes: gid103376,gid109fba,gid115aec,gidf43e6,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!postnews.google.com!z14g2000cwz.googlegroups.com!not-for-mail From: "Jerry Coffin" Newsgroups: comp.lang.ada,comp.lang.c++,comp.realtime,comp.software-eng Subject: Re: Teaching new tricks to an old dog (C++ -->Ada) Date: 8 Mar 2005 06:37:03 -0800 Organization: http://groups.google.com Message-ID: <1110292623.147782.218150@z14g2000cwz.googlegroups.com> References: <4229bad9$0$1019$afc38c87@news.optusnet.com.au> <1110032222.447846.167060@g14g2000cwa.googlegroups.com> <871xau9nlh.fsf@insalien.org> <3SjWd.103128$Vf.3969241@news000.worldonline.dk> <87r7iu85lf.fsf@insalien.org> <87is4598pm.fsf@insalien.org> <1110054476.533590@athnrd02> <1110059861.560004@athnrd02> <87wtsl7jts.fsf@insalien.org> <1110264816.858853.54020@l41g2000cwc.googlegroups.com> NNTP-Posting-Host: 70.33.25.135 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1110292627 7502 127.0.0.1 (8 Mar 2005 14:37:07 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 8 Mar 2005 14:37:07 +0000 (UTC) User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: z14g2000cwz.googlegroups.com; posting-host=70.33.25.135; posting-account=mZiOqwwAAAC5YZsJDHJLeReHGPXV5ENp Xref: g2news1.google.com comp.lang.ada:8857 comp.lang.c++:44602 comp.realtime:1062 comp.software-eng:4614 Date: 2005-03-08T06:37:03-08:00 List-Id: Falk Tannh=E4user wrote: [ ... ] > I would put the "using namespace std;", or even better, just > "using std::swap;" into the "sort" function, at the scope of the > block from where the "swap" is called. Oh, of course. When you're making something visible, you nearly always want to limit the visibility as much as practical. > This way, the precise purpose > of the "using" declaration becomes clear to both the human reader > and the compiler (because unwanted side effects due to name > collisions are avoided). > Furthermore, the implementer of "whatever_type" should consider to > put the specialisation of "swap" into the "std" namespace, which > is possible by =A7 17.4.3.1/1 of the Standard. A perfectly reasonable possiblity, but the sort function shouldn't depend on it. -- Later, Jerry. The universe is a figment of its own imagination.