On 25/08/2011 02:41, Michel Fortin wrote:
<snip>
bool frontEquals(R, V)(R range, V value)
{
    if (range.empty)
        return false;
    else
        return range.front == value;
}

This will work fine with most ranges, but if you encounter an infinite range 
(with empty
defined as "enum empty = false") then the "return false" statement becomes 
unreachable and
you'll get an error/warning? It doesn't make sense.
<snip>

The structure of a flowchart is not affected by the values of variables, or even constants, in it.
                                  _____________
                                 ( frontEquals )
                                  ¯¯¯¯¯¯|¯¯¯¯¯¯
     ______________               ______v______
    ( return false )<--- true ---< range.empty >
     ¯¯¯¯¯¯¯¯¯¯¯¯¯¯               ¯¯¯¯¯¯|¯¯¯¯¯¯
                                      false
                                        |
                          ______________v______________
                         ( return range.front == value )
                          ¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯
Replacing "range.empty" with "false" doesn't magically cause the true arrow to 
vanish.

Stewart.

Reply via email to