From -6023543727790218029 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f78e5,15a3eb1ed336ff4e X-Google-Attributes: gidf78e5,public X-Google-ArrivalTime: 2002-02-14 13:00:02 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!dispose.news.demon.net!news.demon.co.uk!demon!mail2news.demon.co.uk!not-for-mail From: brangdon@cix.co.uk (Dave Harris) Newsgroups: comp.std.c++ Subject: Re: Proposal: Nested inline (function | functor) Date: Thu, 14 Feb 2002 20:59:04 GMT Approved: Fergus Henderson , moderator of comp.std.c++ Message-ID: References: Reply-To: brangdon@cix.co.uk X-Trace: mail2news.demon.co.uk 1013720348 mail2news:9986 mail2news mail2news.demon.co.uk X-Complaints-To: abuse@demon.net X-Mail2News-Path: news.demon.net!mulga.cs.mu.oz.au X-Authentication-Warning: mulga.cs.mu.OZ.AU: fjh set sender to devnull@stump.algebra.com using -f X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov) X-Orig-NNTP-Posting-Host: pc2-clif3-0-cust11.not.cable.ntl.com (80.4.39.11) X-Orig-X-Trace: fu-berlin.de 1013716573 313159 80.4.39.11 (16 [57443]) Lines: 50 Xref: archiver1.google.com comp.std.c++:9643 philippeb@videotron.ca (Philippe A. Bouchard) wrote (abridged): > (I'll post it again and assume I'm right if nobody has a > counterexample.) > > What would you say if the 'inline' keyword would become a deterministic > keyword in nested classes or functions (therefore virtual, recursive or > too much complex functions rejected)? Inlining is best left to the compiler. It usually has more patience and more knowledge of the target hardware. > It would be great here: > > template > void foo(_T const & t) > { > t(); > } > > int main() > { > int i; > > inline bool f() { return i == 1; } > > struct > { > inline bool operator()() { return i == 2; } > } s; > > foo(f); // 'inline' would be needed in order to be accepted > foo(s); // 'inline' of operator() would be needed to be accepted > } I think the word you are looking for is "external". For templates we need some way to request external linkage of nested classes. It has little to do with inlining. Dave Harris, Nottingham, UK | "Weave a circle round him thrice, brangdon@cix.co.uk | And close your eyes with holy dread, | For he on honey dew hath fed http://www.bhresearch.co.uk/ | And drunk the milk of Paradise." --- [ comp.std.c++ is moderated. To submit articles, try just posting with ] [ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ] [ --- Please see the FAQ before posting. --- ] [ FAQ: http://www.research.att.com/~austern/csc/faq.html ]