Path: utzoo!attcan!uunet!pilchuck!ssc!happym!polari!rlb From: rlb@polari.UUCP (rlb) Newsgroups: comp.lang.c++ Subject: Re: unary-expression syntax Summary: How does 'new' bind? Keywords: new,initializer,C++ Message-ID: <459@polari.UUCP> Date: 23 May 88 13:46:22 GMT References: <458@polari.UUCP> Organization: Polarserv, Seattle WA Lines: 17 In article <458@polari.UUCP>, rlb@polari.UUCP (rlb) writes: > In Stroustrup's book, section 7.2 of the reference manual contains: > unary-expression: > ... > new type-name initializer.opt and furthermore, how would something like this bind: int *x = new int = 5 + 6; For 'new' to be treated as an operator with unary binding strength, it looks like the above would have to bind as: int *x = (new int = 5) + 6; which would be a little bizarre; equal sign ceases to be an operator in an expression if a certain unary operator appears to the left of it. On the other hand, if it binds like this: int *x = new int = (5 + 6); then it looks a whole lot more like a primary-expression than a unary op; under what circumstances does its precedence and associativity ever matter? -Ron Burk