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,1d575f572a099528 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-12-19 14:23:57 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.media.kyoto-u.ac.jp!newsfeed.mesh.ad.jp!osa.uu.net!sac.uu.net!ash.uu.net!spool0900.news.uu.net!reader0902.news.uu.net!not-for-mail From: "Hyman Rosen" Newsgroups: comp.lang.ada References: <9ujh51$k6m$1@wanadoo.fr> <3C0EF345.47BCC09@adaworks.com> <568ede3c.0112071202.56fc9f@posting.google.com> <3C13BC4A.1C1EBE8B@adaworks.com> <568ede3c.0112110814.1c31fd91@posting.google.com> <4a885870.0112131636.227e2521@posting.google.com> Subject: Re: What is faster Ada or C? Date: Wed, 19 Dec 2001 17:23:55 -0500 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Organization: KBC Financial Products Message-ID: <1008800619.865084@master.nyc.kbcfp.com> Cache-Post-Path: master.nyc.kbcfp.com!unknown@mosquito.nyc.kbcfp.com X-Cache: nntpcache 2.3.3 (see http://www.nntpcache.org/) NNTP-Posting-Host: 204.253.250.10 X-Trace: 1008800626 reader2.ash.ops.us.uu.net 29073 204.253.250.10 Xref: archiver1.google.com comp.lang.ada:18128 Date: 2001-12-19T17:23:55-05:00 List-Id: "Will" wrote in message news:4a885870.0112131636.227e2521@posting.google.com... > main.cpp: > inline int callme(); > main() { callme(); } > test.cpp: > inline int callme() { return 0; } > will not compile. Tested with g++ and Visual C++ Yes, I know. As I have said, C++ requires that the definition (i.e., the body) of an inline function must be in scope when it is called. But you may still have a declaration separate from a definition, which (apparently) Richard Riehle assumed was not the case. This means that you can write your classes without defining the inline methods, and define them separately. This is legal: struct a { int f(); }; inline int a::f() { return 0; } main() { a an_a; an_a.f(); }