From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13275 invoked by alias); 30 Jul 2003 14:36:14 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 13256 invoked from network); 30 Jul 2003 14:36:13 -0000 Received: from unknown (HELO ibm-4.MPA-Garching.MPG.DE) (130.183.83.34) by sources.redhat.com with SMTP; 30 Jul 2003 14:36:13 -0000 Received: from mpa-garching.mpg.de (ncb-3.MPA-Garching.MPG.DE [130.183.84.13]) by ibm-4.MPA-Garching.MPG.DE (AIX4.3/8.9.3/8.9.1) with ESMTP id QAA154320; Wed, 30 Jul 2003 16:36:09 +0200 Message-ID: <3F27D7D9.5050705@mpa-garching.mpg.de> Date: Wed, 30 Jul 2003 15:27:00 -0000 From: Martin Reinecke Organization: Max-Planck-Institut fuer Astrophysik User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Gabriel Dos Reis CC: gcc@gcc.gnu.org Subject: Re: std::pow implementation References: <3F27BD38.8020009@mpa-garching.mpg.de> <3F27C5DE.2010604@mpa-garching.mpg.de> <3F27D07A.9070602@mpa-garching.mpg.de> In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-07/txt/msg02189.txt.bz2 Gabriel Dos Reis wrote: > The standard does mandate that the definition of an inline function > be available in every translation unit that uses it. Thanks for the clarification. But I think there is still no way to expose the definition of a not-explicitely-inline function to all translation units where it is used. The fundamental problem is that there are three classes of functions: - functions that should always be inlined - functions where the compiler should decide - functions that should never be inlined The first category must have its definition in a header file. The second category should have its definition in a header file also, to give the compiler a chance of inlining it. But C++ won't let us, because all functions with their definition in a header automatically belong to the first category. Something seems fundamentally wrong here, and I think it is C++'s property to automatically put the "inline" tag on all functions defined in a class body, even if they don't have the "inline" keyword. But I see no chance to get this changed. Maybe the discussion is so intense because there is no real solution? Martin