
[any.hpp mysterious false?exp1:exp2 expr]:
In any.hpp, there's several expressions like:
false? this->_boost_type_erasure_deduce_constructor(arg...) : 0
Since:
false?exp1:exp2
always evaluates to exp2, this just obscures the code. It should be replaced with exp2(i.e. 0) or some in-source comment attached explaining why the ?: operator is needed.
This use of the conditional operator is a technique to determine the type of an expression without evaluating it. In this case, "arg..." will never be evaluated (since it appears in a false branch of a conditional expression), but its type will influence the type of the entire conditional expression. Eric Niebler explains this technique nicely in this article [1] (see page 2 in particular). Regards, Nate [1] http://www.artima.com/cppsource/foreach.html