From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32613 invoked by alias); 5 Jul 2005 14:52:24 -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 31980 invoked by uid 22791); 5 Jul 2005 14:51:57 -0000 Received: from mr1.netezza.com (HELO mail2.netezza.com) (12.148.248.137) by sourceware.org (qpsmtpd/0.30-dev) with SMTP; Tue, 05 Jul 2005 14:51:57 +0000 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: position of inline reserved word Date: Tue, 05 Jul 2005 14:52:00 -0000 Message-ID: From: "John Yates" To: "Gcc-Help \(E-mail\)" X-SW-Source: 2005-07/txt/msg00035.txt.bz2 Personal predilection: ---------------------- Having first encountered strong typing in Pascal I am one of those programmers who will forever write char* ptr rather than char *ptr Issue at hand: -------------- To make it easy to spot a function name and its result type I format the definition's function header across two lines: :: ( ) When writing C++ headers I always provide inline definitions outside of the class declaration. If this is an inline definition I would like to write inline :: ( ) Unfortunately this only works if is a single identifier. Consider this example: class C { int F_simple_type(); int* F_inline_first(); int* F_split_type(); int* F_desired(); int X; }; int inline C:: F_simple_type() { return X; =20=20=20=20=20=20 } inline int* C:: F_inline_first() { return &X; =20=20=20=20=20=20 } int inline *C:: F_split_type() { return &X; =20=20=20=20=20=20 } int* inline C:: F_desired() { return &X; =20=20=20=20=20=20 } F_simple_type shows that I can use my preferred format when is simple. F_inline_first and F_split_type show syntaxes that are accepted by the g++ 3.4.2 complier. But when I try use this preferred format with a complex type (e.g. F_desired) I get the errors: error: expected unqualified-id before "inline" error: expected init-declarator before "inline" error: expected `,' or `;' before "inline" Request to list: ---------------- Could someone who is familiar with the C++ standard explain the logic that makes -- what for at least some programmers is the clearest format -- invalid? /john -- John S. Yates, Jr. 508 665-6897 (voice) Netezza Inc 508 665-6811 (fax) 200 Crossing Blvd. Framingham, MA 01701 =20