Skip to content

Mark functions as [[nodiscard]] #490

@tambry

Description

@tambry

Describe the feature

Today I wrote code analogous to this:

auto config{zenoh::Config::create_default()};
config.from_str("...");

Unfortunately turns out that the second call is completely useless!
If it had been marked [[nodiscard]] it would've saved me a few hours of debugging.
And so should probably a majority of functions, which only return values and don't have other side effects.

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