Skip to content

Additional edge test in max-of-vector needed #242

@mariuszlisowski

Description

@mariuszlisowski

Test against the edge case when the vector is empty. Could be useful when std::max_element() is used form algorithm header and dereferencing its result could cause segmentation fault.

If iterative solution is used, when nothing is found then std::numeric_limits::min() may be returned if defined.
Similarly if max is initialized with the first element of a vector - SegFault.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions