|
Boost : |
Subject: Re: [boost] painless currying
From: Paul Mensonides (pmenso57_at_[hidden])
Date: 2011-09-01 21:40:17
On Thu, 01 Sep 2011 18:23:16 -0400, Edward Diener wrote:
> The remark refers in the resolution above refers to "my reading of the
> standard" but does not say which standard is being referred to. Is this
> part of C99 or C++11 ? I have asked about this on the C++ standard NG
> and am awaiting an answer.
>
> I am surprised by the evaluation of "#elif constant expression" when the
> corrwesponding #if statament is true because it means that #if - #elif
> is not equivalent to #if - #else - #if in this particular case, and I am
> sure many C++ programmers would have expected that the two were indeed
> equivalent.
It doesn't "evaluate" it; it just parses it. Even in normal code and, in
most cases, even with dynamically-typed code, the compiler or interpreter
still has to parse the else-if expressions. Neither C99 or C++98 (or C+
+11) are particularly clear on this. To me that means that the solution
is on the code side rather than requiring a compiler to allow semi-
unspecified behavior in the short term and to alter the standard if it is
important enough in the long term.
-Paul
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk