From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14985 invoked by alias); 25 Jul 2005 19:32:25 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 14975 invoked by uid 22791); 25 Jul 2005 19:32:20 -0000 Received: from exprod6og7.obsmtp.com (HELO psmtp.com) (64.18.1.127) by sourceware.org (qpsmtpd/0.30-dev) with SMTP; Mon, 25 Jul 2005 19:32:20 +0000 Received: from source ([192.150.11.134]) by exprod6ob7.obsmtp.com ([64.18.5.12]) with SMTP; Mon, 25 Jul 2005 12:32:18 PDT Received: from inner-relay-1.corp.adobe.com ([153.32.1.51]) by outbound-smtp-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id j6PJPZBM019684 for ; Mon, 25 Jul 2005 12:25:35 -0700 (PDT) Received: from iplan-mn (iplan-mn.corp.adobe.com [10.32.16.20]) by inner-relay-1.corp.adobe.com (8.12.10/8.12.10) with ESMTP id j6PJWHn2013594 for ; Mon, 25 Jul 2005 12:32:17 -0700 (PDT) Received: from iplan-mn (localhost [127.0.0.1]) by iplan-mn.corp.adobe.com (iPlanet Messaging Server 5.2 HotFix 2.02 (built Oct 21 2004)) with ESMTP id <0IK7000HM7LT50@iplan-mn.corp.adobe.com> for gcc-help@gcc.gnu.org; Mon, 25 Jul 2005 14:32:17 -0500 (CDT) Received: from [10.32.17.150] (mn-dhcp-17-150.corp.adobe.com [10.32.17.150]) by iplan-mn.corp.adobe.com (iPlanet Messaging Server 5.2 HotFix 2.02 (built Oct 21 2004)) with ESMTP id <0IK70001A7LT4W@iplan-mn.corp.adobe.com> for gcc-help@gcc.gnu.org; Mon, 25 Jul 2005 14:32:17 -0500 (CDT) Date: Mon, 25 Jul 2005 19:32:00 -0000 From: Eljay Love-Jensen Subject: Re: Problem with class operators. In-reply-to: To: Kristian Kratzenstein , gcc-help@gcc.gnu.org Message-id: MIME-version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT User-Agent: Microsoft-Entourage/11.1.0.040913 X-SW-Source: 2005-07/txt/msg00269.txt.bz2 Hi Kristian, > What is now my conclusion : put small methods into the class decleration. > But this looks dirty (sorry, but I try to hold my code clean). Yes, put the non-specialized template method definitions in the header file. That is where they belong. You are not keeping your code clean by moving the non-specialized template methods to a .cpp file. Although if you REALLY want to do something like that to keep those things separated, I highly recommend putting your non-specialized template methods, along with your (explicitly) inline functions, into a file with the extension .inl and then include that file at the end of your .h file. For example: ----- foo.h ----- #ifndef foo_h_once #define foo_h_once // blah blah blah #include "foo.inl" #endif ----------------- > Is no other way, to stop gcc to inline small methods ? q.v. these switches -Winline Warn when an inlined function cannot be inlined -finline Pay attention to the "inline" keyword -finline-functions Integrate simple functions into their callers -finline-limit- This switch lacks documentation -finline-limit= Limit the size of inlined functions to -fkeep-inline-functions Generate code for functions even if they are fully inlined -fobey-inline Obey 'inline' keyword and always inline, max-inline-insns-single The maximum number of instructions in a single max-inline-insns-auto The maximum number of instructions when max-inline-insns-recursive The maximum number of instructions inline max-inline-insns-recursive-auto The maximum number of instructions non-inline max-inline-recursive-depth The maximum depth of recursive inlining for inline functions max-inline-recursive-depth-auto The maximum depth of recursive inlining for non-inline functions inline-unit-growth how much can given compilation unit grow because inline-call-cost expense of call operation relative to ordinary -fdefault-inline Inline member functions by default -fimplement-inlines Export functions even if they can be inlined -fimplicit-inline-templates Emit implicit instantiations of inline templates -fvisibility-inlines-hidden Marks all inlined methods as having hidden -fdefault-inline, -fdollars-in-identifiers, -felide-constructors, -fhandle-exceptions, -fhonor-std, -fhuge-objects, -fimplement-inlines, -fimplicit-inline-templates, -fimplicit-templates, -finput-charset=, -fvisibility-inlines-hidden, -fvtable-gc, -fvtable-thunks, -fweak, I produced this list via: gcc -v --help >gcc.help 2>&1 grep inline gcc.help HTH, --Eljay