From 3262296837410275572
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,13ce76b24fcf616c
X-Google-Attributes: gidf78e5,public
From: James Kuyper <kuyper@wizard.net>
Subject: Re: Operator precedence
Date: 1999/12/29
Message-ID: <3868E643.D90C65F4@wizard.net>#1/1
X-Deja-AN: 565911514
Content-Transfer-Encoding: 7bit
Approved: Fergus Henderson <fjh@cs.mu.oz.au>
References: <3868B1A1.D47627B4@kobasoft.nl>
X-Original-Date: Tue, 28 Dec 1999 11:33:07 -0500
X-Accept-Language: en, es, de, ru
Content-Type: text/plain; charset=us-ascii
X-Complaints-To: news@news.unimelb.edu.au
X-Trace: ariel.ucs.unimelb.edu.au 946439385 2731 128.250.37.153 (29 Dec 1999 03:49:45 GMT)
Organization: NASA Goddard Space Flight Center -- Greenbelt, Maryland USA
X-Auth: PGPMoose V1.1 PGP comp.std.c++ iQBFAgUAOGmFAeEDnX0m9pzZAQE2XAF/bIvs2mPgbkZ+EqUVsN3pVsp4zv10MnBH h1KUup1erX/yqIl9YtzOSYHi39d8X38n =cnQS
Mime-Version: 1.0
NNTP-Posting-Date: 29 Dec 1999 03:49:45 GMT
Newsgroups: comp.std.c++

Pieter van Beek wrote:
> 
> Hi all,
> 
> There seems to be no operator precedence table in de ansi C++ standard.
> I always used the one from Stroustrup, and only found out yesterday this
> topic is not covered by the standard.

The C++ language cannot be described exactly in terms of precedence
rules for operators. Instead, grammar rules are used. Some of those
grammar rules imply relationships which are equivalent to those
described by precedence rules, but others are impossible to describe
that way.

The ?: operator, in particular, causes problems simply because it's the
only ternary operator. It's been argued that '?expression:' can be
thought of as being a binary operator, and that when considered as such,
has effectively equal precedence with assignment operators.
---
[ 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://reality.sgi.com/austern_mti/std-c++/faq.html              ]



