 |
C++Talk.NET C++ language newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Loïc Joly Guest
|
Posted: Sat Sep 13, 2003 9:45 am Post subject: Re: operateur c=cond?a:b |
|
|
Tom D. wrote:
| Quote: | j'aimerais s'avoir ce que fait exactement cet opérateur.
de quelle code ce raproche-il le plus ?
c=(cond?a:b)
|
[Est-ce que a et b sont évalués, ou un seul des deux ?]
Un extrait du standard :
The first expression is implicitly converted to bool (clause 4).
It is evaluated and if it is true, the result of the conditional
expression is the value of the second expression,
otherwise that of the third expression. All side effects of the first
expression except for destruction of
temporaries (12.2) happen before the second or third expression is
evaluated. Only one of the second and
third expressions is evaluated.
En français : un seul est évalué.
--
Loïc
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|