Skip to content

STL: Consider using P1301R4 [[nodiscard("message")]] #271

Description

WG21-P1301 [[nodiscard("message")]] has been implemented for VS 2019 16.5 and has also been implemented by Clang 9.

We should consider using this in the STL. We have a few criteria for marking functions as [[nodiscard]]: pure observer (most common), resource leak, incorrect behavior (e.g. remove_if()). We could have macros for each of these reasons.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementSomething can be improvedfixedSomething works now, yay!

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions