lambda retournant bool

Je veux trouver le point qui a le moins de coordonnée Y (si plusieurs de ces points, trouver celui avec le plus petit X).
Lors de l'écriture avec lambda:

    std::min_element(begin, end, [](PointAndAngle& p1, PointAndAngle& p2) {
        if (p1.first->y() < p2.first->y())
            return true;
        else if (p1.first->y() > p2.first->y())
            return false;
        else 
            return p1.first->x() < p2.first->x();
    }

J'obtiens:

error C3499: a lambda that has been specified to have a void return type cannot return a value

quelle est la différence entre:

    //works
    std::min_element(begin, end, [](PointAndAngle& p1, PointAndAngle& p2) {
        return p1.first->y() < p2.first->y();
    }

et

    //does not work
    std::min_element(begin, end, [](PointAndAngle& p1, PointAndAngle& p2) {
        if (p1.first->y() < p2.first->y())
            return true;
        else 
            return false;
    }

source d'informationauteur relaxxx | 2011-10-25